I am posting this here because there is regex and whatnot with mod_rewrite. If this is in the wrong forum please move it.
And on to my question...
I want to make a rewrite rule that would turn this:
http://server/news/
into:
http://server/news.php
but I also want to turn any extra directorys into GET params like this:
http://server/news/new/
into:
http://server/news.php?_view=new
As I am terrible at regex and nearly clueless on mod_rewrite I was wondering if I could get a little help.
Mod Rewrite Help
Moderator: General Moderators
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
Ok I got everything going nicely but I am still having a few problems. I want to keep all get parameters intact and showing. For example:
I have this url: http://localhost/languages/update/?fk_entry=2
and I have this rewrite rules list:
this will remove the fk_entry=2 param, but I need to keep that because what I want the URL to look like is this:
http://localhost/languages.php?_view=update&fk_entry=2
I have tried this rule but to no avail:
any help would be fantastic
I have this url: http://localhost/languages/update/?fk_entry=2
and I have this rewrite rules list:
Code: Select all
RewriteRule ^([a-z]*)/([a-z]*)$ $1.php?_view=$2
RewriteRule ^([a-z]*)/([a-z]*)/$ $1.php?_view=$2http://localhost/languages.php?_view=update&fk_entry=2
I have tried this rule but to no avail:
Code: Select all
RewriteRule ^([a-z]*)/([a-z]*)(\?*)$ $1.php?_view=$2&$3
RewriteRule ^([a-z]*)/([a-z]*)/(\?*)$ $1.php?_view=$2&$3- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm