I am trying to rewrite a few links with htaccess
- by Thorpe Obazee
I have a few URLs and I need them to be rewrite'd to the ones below:
http://domain.net/blog/posts
http://domain.net/blog/posts/index
http://domain.net/blog/posts/view/uri/non-working-holiday
http://domain.net/blog/posts/view/uri/we-no-longer-offer
http://domain.net/blog/posts/view/uri/festivals
http://domain.net/blog/posts/view/uri/christmas-is-just-around-the-corner
http://domain.net/posts/
http://domain.net/posts/index
http://domain.net/posts/view/uri/non-working-holiday
http://domain.net/posts/view/uri/we-no-longer-offer
http://domain.net/posts/view/uri/festivals
http://domain.net/posts/view/uri/christmas-is-just-around-the-corner
I was hoping that my .htaccess will fix this but it doesn't:
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
RewriteRule ^blog\/(.*)$ posts\/$1 [NC]
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php