This is a discussion on mod_rewrite: must the rewritten url exist? (nu-B) within the Apache Web Server forums, part of the Web Server and Related Forums category; suppose the requested url is www.server.com/page.php?qs=s and in the address bar i want it ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
suppose the requested url is
www.server.com/page.php?qs=s and in the address bar i want it displayed as www.server.com/s while still serving www.server.com/page.php and not having any www.server.com/s/index.php is this possible? |
|
|||
|
Yes, this is possible, no the filename can exist but needn't.
And where do you expect to use mod_rewrite? In your httpd.coonf/per-server context or in per-dir context (e.g. .htaccess files)? RewriteEngine on # exclude slash and period RewriteRule ^([^/.]+)$ /page.php?qs=$1 [L] -- Robert |
|
|||
|
Robert Ionescu wrote: > Yes, this is possible, no the filename can exist but needn't. > > And where do you expect to use mod_rewrite? In your > httpd.coonf/per-server context or in per-dir context (e.g. .htaccess files)? It probably will be on a server where I cannot access httpd.conf. >From the little I've read, I remember something about having to use rewriteBase. > RewriteEngine on > # exclude slash and period > RewriteRule ^([^/.]+)$ /page.php?qs=$1 [L] This is really strange... I would've written something like RewriteRule ^(.*=)(.*)$ www.server.com/$2 Anyway, don't give me the answer to this one, I need the homework :) > > -- > Robert |