i have a specific question concerning mod_rewrite:
when the user calls:
www.test.com/p/about
the webserver should call internally
www.test.com/?p=about
to access subpages of the website.
but in the adress bar it should still say
www.test.com/p/about
is this anyhow possible with mod_rewrite?
My solutions that did not work out:
RewriteRule ^/?([-a-zA-Z0-9_+]+)$ index.php?p=$1 [L]
RewriteRule ^p/([a-zA-Z]+)$ index.php?p=$1
big thanks, stee
mod_rewrite
- did you have a go at it yourself yet? What have you tried so far - DaveRandom 2012-04-03 22:54
Yes, this is possible with mod_rewrite:
RewriteRule ^p/([a-zA-Z]+)$ index.php?p=$1
Or, more generally:
RewriteRule ^([a-zA-Z]+)/([a-zA-Z]+)$ index.php?$1=$2
See: http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewriterule