Forum Moderators: phranque

Message Too Old, No Replies

Mod Rewrite everything to a handler

         

mealybar

10:28 pm on Jul 16, 2008 (gmt 0)

10+ Year Member



I want to go from

[website.com...]

to

[website.com...]

and so that I could replicate that for other directories other than /news. From various bits I've done before I can get one directory working using:

RewriteRule ^([^/\.]+)/?$ /news/index.php?q=$1 [L]

But that stops at the first forward slash. So I figured I needed something to match everything:

RewriteRule ^(.*)$ /news/index.php?q=$1 [L]

All I get is 500 errors =/ Any help would be much appreciated.

jdMorgan

11:50 pm on Jul 16, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I assume you're putting the code into /news/.htaccess, then.

What's needed is an exclusion -- to prevent rewriting /news/index.php to itself:


RewriteCond $1 !^index\.php$
RewriteRule (.*) /news/index.php?q=$1 [L]

Jim