Here is the code that removes index.php from the url.
RewriteEngine On
RewriteBase /
# remove the www
RewriteCond %{HTTP_HOST} ^(www\.$) [NC]
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Add a trailing slash to paths without an extension
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule ^(.*)$ $1/ [L,R=301]
# Remove index.php
# Uses the "include method"
# http://expressionengine.com/wiki/Remove_index.php_From_URLs/#Include_List_Method
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5})$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $1 ^({ee:template_groups}|{ee:pages}members|P[0-9]{2,8}) [NC]
RewriteRule ^(.*)$ /index.php/$1 [L]
I have added redirects to the bottom of this file ie Redirect 301 http://www.mydomain/newsroom/newsroom.asp http://www.mydomain/newsroom
The old site was hosted on a asp platform and the redesigned site is now hosted on php / expression engine. I have created loads of redirects links as above for the new site. These redirects are not working is there a special way in which I should enter them? I am using LG .htaccess Generator 1.0.0
Any help appreciated.
Thank you
Everything in a .htaccess file is processed from the top down for every request to the server. The URLs you are trying to redirect are likely being rewritten prior to your Redirect lines. Try placing it above the Rewrite On line (as Redirect does not need the Rewrite engine to be on at that point, you will probably want to modify the Redirect line to be a URI to a full URL:
Redirect 301 /newsroom/newsroom.asp http://www.mydomain/newsroom/
RewriteEngine On
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.