This is a discussion on mod_rewrite - Module, File and Parameters within the Apache Web Server forums, part of the Web Server and Related Forums category; Hi there, I wrote an RewriteRule to rewrite URLs like http://example.org/<Module>/<Submodule>/<...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi there,
I wrote an RewriteRule to rewrite URLs like http://example.org/<Module>/<Submodule>/<File>.ext to http://example.org/index.ext?Module=<Module>&SubModule=<SubModule>Inc ludeFile=<File> with RewriteRule ^/(.*)/(.*)/(.*)\.ext$ /index.ext?Module=$1&SubModule=$2&IncludeFile=$3 What I was not able to do is: (1) How can I parse any following parameters (.../File.ext?do=var&do1=var1) to index.ext? Of course, these additional parameters should be optional. (2) How can I exclude directories like /images or /style from this rewrite rule? Many thanks in advance, Thomas |
|
|||
|
"Thomas Schager" <thomas.schager@gmx.net> schreef in bericht
news:241f4$45df04cd$557c66d7$20424@news.inode.at.. . > I wrote an RewriteRule to rewrite URLs like > http://example.org/<Module>/<Submodule>/<File>.ext > to > http://example.org/index.ext?Module=<Module>&SubModule=<SubModule>Inc ludeFile=<File> > with > RewriteRule ^/(.*)/(.*)/(.*)\.ext$ > /index.ext?Module=$1&SubModule=$2&IncludeFile=$3 > > What I was not able to do is: > (1) How can I parse any following parameters > (.../File.ext?do=var&do1=var1) to index.ext? Of course, these additional > parameters should be optional. Add a flag at the end of the rule [QSA] > > (2) How can I exclude directories like /images or /style from this rewrite > rule? Rather add a base folder to your concept to http://example.org/base/<Module>/<Submodule>/<File>.ext If you do not want to shift base, add before the rule RewriteCond %{REQUEST_URL} !^/(images|scripts)/ HansH |
| Thread Tools | |
| Display Modes | |
|
|