Strange behaviour : GET vars doubled

Oh, the strange things mod_rewrite does!

Strange behaviour : GET vars doubled

Postby theredled » Sat May 24, 2008 11:26 am

Hi all,

I have a problem with the .htaccess of a particular website :

I want to rewrite URLs like "/admin/js_inc/functions.js" to "/www_bo/js/include_js.php5?file=functions.js"

Here are the corresponding rules :

Code: Select all
RewriteRule ^admin/(.*)   www_bo/$1
RewriteRule ^www_bo/js_inc/(.*)$   www_bo/js/include_js.php5?file=$1 [L]


But it doesn't work like it should, it makes "/www_bo/js/include_js.php5?file=functions.js/js_inc/functions.js" in place of "/www_bo/js/include_js.php5?file=functions.js"...

Any idea ?

Here is the complete htaccess, if you need it :

Code: Select all
RewriteEngine on

RewriteRule ^$   www_fo/waiting.php5 [L]

RewriteRule ^phpmyadmin/.*$ - [L]

RewriteRule ^(.*)\.php$   $1.php5

RewriteCond %{REQUEST_URI} !^/(www_fo|admin|www_bo).*   RewriteRule ^(.*)$   www_fo/$1

RewriteRule ^www_fo/\w*-(\d+)\.html$   www_fo/index.php?tpage=produit&id=$1

RewriteRule ^admin/(.*)   www_bo/$1

RewriteRule   ^www_bo/([a-zA-Z0-9_-]*)\.htm$   www_bo/index.php5?tpage=$1 [QSA,L]
RewriteRule ^www_bo/js_inc/(.*)$   www_bo/js/include_js.php5?file=$1 [L]

RewriteRule ^(.*)$    -   [L]



Many thanks
theredled
 
Posts: 1
Joined: Sat May 24, 2008 10:46 am

Postby richardk » Sun May 25, 2008 10:07 am

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^$ /www_fo/waiting.php5 [L]
RewriteRule ^phpmyadmin(/.*)?$ - [L]

RewriteRule ^(.+)\.php$ /$1.php5

RewriteCond %{REQUEST_URI} !^/(www_fo|admin|www_bo)(/.*)?$ [NC]
RewriteRule ^(.*)$ /www_fo/$1
RewriteRule ^www_fo/\w*-(\d+)\.html$ /www_fo/index.php?tpage=produit&id=$1 [QSA,L]

RewriteRule ^admin/(.*)$ /www_bo/$1
RewriteRule ^www_bo/([a-zA-Z0-9_-]+)\.htm$ /www_bo/index.php5?tpage=$1 [QSA,L]
RewriteRule ^www_bo/js_inc/(.*)$ /www_bo/js/include_js.php5?file=$1 [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Idiosyncrasies

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron