Hi,
I now understand mod_rewrite to a greater extent.
However, I was wondering if anyone could tell me how to re-write my rule so that i can simply declar my variable straight after the domain name
e.g.
What I want to do is re-write: http://www.site.com/registration - where registration would be a variable
At the moment I have to write it like this: http://www.site.com/index/registration - I basically want to get rid of "index".
Here is my rule: RewriteRule (.*)//(.*) $1.php?parameters=$2
Thanks.
Using mod_rewrite
Moderator: General Moderators
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: Using mod_rewrite
Most common way to rewrite is done with the following
Rewrites everything to index, then the Front Controller would decide how to set everything.
To answer your question though..
Matches everything but the /'s
Code: Select all
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]To answer your question though..
Code: Select all
RewriteRule ([^/]*)$ index.php?param=$1