I am trying to use mod_rewrite in an .htaccess file with no success. I do not get any errors, but I do not get any rewrites, either.
In trying to convert my query string URLs to be more SEO friendly, I am having trouble wrapping my head around this. My URLs do not always have the same number of words or characters, and the words are separated by hyphens. I would like these:
http://library-place.com/phase2/library-place.php
http://library-place.com/phase2/library ... -amenities
http://library-place.com/phase2/downtow ... -dine-play
To become these:
http://library-place.com/phase2/library-place
http://library-place.com/phase2/library ... -amenities
http://library-place.com/phase2/downtow ... -dine-play
(/phase2/ is temporary, how would I add this and remove it later?)
There are 7 php pages I need to rewrite, 4 of which have subpages created via query string. Here is what I have so far:
- Code: Select all
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^phase2/library-place/(.*[^/])/?$ /library-place.php?p=$1 [QSA,L]
RewriteRule ^phase2/downtownliving/(.*[^/])/?$ /downtown-living.php?p=$1 [QSA,L]
RewriteRule ^phase2/the-homes/(.*[^/])/?$ /the-homes.php?p=$1 [QSA,L]
RewriteRule ^phase2/skotdal-real-estate /skotdal-real-estate.php [QSA,L]
RewriteRule ^phase2/leasing-details/(.*[^/])/?$ /leasing-details.php?p=$1 [QSA,L]
RewriteRule ^phase2/contact /contact.php [QSA,L]
RewriteRule ^phase2/retail /retail.php [QSA,L]
Thank you very much in advance!