kfordham281 Posted August 12, 2008 Share Posted August 12, 2008 I'm redoing a site for an organization I volunteer for and I'm changing to php pages from html pages (adding functionality). I'm fairly certain I need to use a .htaccess file to reroute the .htm pages to .php. E.g contact.htm needs to forward on to contact.php. Does anyone have any good advice on the best methods to do this? If it's a .htaccess file, can you suggest the correct code to go in it? Thanks. Quote Link to comment Share on other sites More sharing options...
TCH-Bruce Posted August 12, 2008 Share Posted August 12, 2008 Create an .htaccess file and put the following in it. Should do what you want. >Options +FollowSymlinks RewriteEngine on RewriteRule ^(.*)\.htm$ $1.php [nc] Quote Link to comment Share on other sites More sharing options...
Kevan Posted August 12, 2008 Share Posted August 12, 2008 (edited) You can use CPanel to setup redirects too but that is not as easy as what Bruce shows. If you replace your html files (delete them) with php files (upload them) your site will use the new php files without the redirects...AS long as you change all the site navigation links on your pages and menus. (Your menu links will be to contact.php instead of contact.html for example as you said) If your site has been up for awhile the redirects will help convert external links to your site. Edited August 12, 2008 by Kevan 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.