Welcome to WebmasterWorld Guest from 54.196.110.18

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Mod rewrite doesn't work with parameter(s)

     
2:09 am on Feb 19, 2008 (gmt 0)

Full Member

10+ Year Member

joined:Jan 19, 2003
posts:324
votes: 0


#My .htaccess file

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^test1/$ test1.php [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^test2/$ test2.php?page=1 [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^test3/([0-9]+)/$ test3.php?page=$1 [L]

test1: work
test2: doesn't work, isset($_GET['page']) == FALSE
test3: doesn't work, isset($_GET['page']) == FALSE

What's wrong?

[edited by: iProgram at 2:21 am (utc) on Feb. 19, 2008]

4:48 pm on Feb 19, 2008 (gmt 0)

Full Member

10+ Year Member

joined:Dec 3, 2006
posts:257
votes: 0


It works for me. (tested on my server)
2:11 am on Feb 20, 2008 (gmt 0)

Full Member

10+ Year Member

joined:Jan 19, 2003
posts:324
votes: 0


The problem is a result of an Apache option named MultiViews. When the server receives a request for the "test1" directory and there is no such directory, the server is looking for test1.* files and chooses the test1.php file.

As a workaround, I add the following line at the top of .htaccess file:

Options -MultiViews

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members