index.php returned in $1

Oh, the strange things mod_rewrite does!

index.php returned in $1

Postby rocksfrow » Tue Oct 09, 2007 11:44 am

simply want to pass EVERYTHING after domain.com/ to index.php?request=$1

RewriteRule ^(.*)$ index.php?request=$1

$_GET['request'] equals 'index.php'


any clue?
rocksfrow
 
Posts: 2
Joined: Tue Oct 09, 2007 11:41 am

Postby richardk » Tue Oct 09, 2007 12:23 pm

It's looping (/something --> /index.php?request=something --> /index.php?request=index.php --> etc.) until it reaches it's limit (sometimes it will cause a 500 error, depending on the configuration).

Code: Select all
Options +FollowSymLinks

RewriteEngine On

# Don't loop.
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^(.*)$ /index.php?request=$1 [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby rocksfrow » Tue Oct 09, 2007 12:32 pm

wow, you're awesome thanks
rocksfrow
 
Posts: 2
Joined: Tue Oct 09, 2007 11:41 am


Return to Idiosyncrasies

Who is online

Users browsing this forum: No registered users and 5 guests

cron