This is a discussion on mod_rewrite and special characters - HELP! within the Linux Web Servers forums, part of the Web Server and Related Forums category; I am using mod_rewrite with a small PHP content manager. I put the following in .htaccess: RewriteEngine on RewriteBase /site ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I am using mod_rewrite with a small PHP content manager.
I put the following in .htaccess: RewriteEngine on RewriteBase /site RewriteRule ^pages/(.*).html index.php?$1 RewriteRule ^pages/(.*) index.php?$1 All pages work except pages with special characters in the url. For example, /site/pages/joe'spage.html does not work /site/pages/joe%27spage.html does not work /site/pages/joe%2527spage.html DOES WORK For some strange reason, I need to replace all instances of "%" with "%25" I cannot do this with my content manager-- I want to solve the problem with mod_rewrite. What can I put in .htaccess to make it properly handle urls that have % and other special characters in them? Thanks! |
|
|||
|
In article <c3c55ce2.0307301306.4fdb6141@posting.google.com >,
hknight <hknight@graffiti.net> wrote: >I am using mod_rewrite with a small PHP content manager. > >I put the following in .htaccess: > > RewriteEngine on > RewriteBase /site > RewriteRule ^pages/(.*).html index.php?$1 > RewriteRule ^pages/(.*) index.php?$1 > >What can I put in .htaccess to make it properly handle urls that have >% and other special characters in them? Add the [NE] flag? nhoJ -- John P Baker |
|
|||
|
>
> Add the [NE] flag? > Good idea. But it doesn't help. I tried RewriteEngine on RewriteBase /pcc2 RewriteRule ^pages/(.*).html index.php?$1 [NE] RewriteRule ^pages/(.*) index.php?$1 [NE] And it still does not work. I also tried RewriteEngine on RewriteBase /pcc2 RewriteRule ^pages/(.*).html index.php?$1 [NE] RewriteRule ^pages/(.*) index.php?$1 [NE] RewriteRule ^(.*)%(.*)$ $1%25$2 [N] and it DID NOT work either . . . |