Seite 1 von 1

mod_rewrite /p/about => ?p=about

Verfasst: 13.04.2012 19:16
von blind4x
i have a specific question concerning mod_rewrite:

when the user calls:
the webserver should call internally
to access subpages of the website.

but in the adress bar it should still say
is this anyhow possible with mod_rewrite?

My solutions that did not worked out:

1. Try:

Code: Alles auswählen

RewriteRule ^/?([-a-zA-Z0-9_+]+)$ index.php?p=$1 [L]
Wrong effect, because it only works with: test.com/about, but I need test.com/p/about!

2. Try:

Code: Alles auswählen

RewriteRule ^p/([a-zA-Z]+)$ index.php?p=$1
Error: it redirects correct but the paths on the html file are wrong: eg. /img/pic.png is now /p/img/pic.png

big thanks, stee