deansaddigh Posted July 20, 2010 Share Posted July 20, 2010 Does anyone know how to get htacess file working on fasthosts. Im trying to get search engine friendly urls with this RewriteEngine on RewriteRule ^(.*)$ $1.php it doesnt seem to do anything. Any help would be brill Quote Link to comment Share on other sites More sharing options...
cags Posted July 21, 2010 Share Posted July 21, 2010 What URL are you typing in/ clicking on. Quote Link to comment Share on other sites More sharing options...
deansaddigh Posted July 22, 2010 Author Share Posted July 22, 2010 http://www.languageschoolsuk.com/view_all_schools.php I wanna acess it like http://www.languageschoolsuk.com/view_all_schools And also i wanna re-write links like this http://www.languageschoolsuk.com/school_details.php?id=126 to a more friendly seo link Quote Link to comment Share on other sites More sharing options...
cags Posted July 22, 2010 Share Posted July 22, 2010 Your rule will work given the example URL you gave, typing in or clicking a link to... http://www.languageschoolsuk.com/view_all_schools ...will display... http://www.languageschoolsuk.com/view_all_schools.php Due to the extreme simplicity of your pattern though it will match every single link on your site, including the ones it has already redirected. RewriteEngine on RewriteCond %{REQUEST_URI} !-f RewriteCond %{REQUEST_URI} !-d RewriteRule ^([^.])$ /$1.php Would be closer, because this way you are only rewriting patterns URLs that don't exist as a file or directory, plus you are only rewriting rules that don't contain a fullstop, meaning you won't match anything that already has a file extension. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.