dbrimlow Posted July 6, 2007 Share Posted July 6, 2007 I renamed @ 2 dozen pages that had used a php extension to use .html (they used to have a php includes for the nav bar). Can I simply place a redirect in my http.conf file (instead of using mod_rewrite)? redirect 301 /oldpage1.php http://www.mysite.com/oldpage1.html redirect 301 /somepage2.php http://www.mysite.com/somepage2.html redirect 301 /anotherpage3.php http://www.mysite.com/anotherpage3.html redirect 301 /thatpage4.php http://www.mysite.com/thatpage4.html etc... or should I do: RewriteEngine On RewriteBase/ RewriteRule ^oldpage1\.php$ oldpage1.html [R=301,L] RewriteEngine On RewriteBase/ RewriteRule ^somepage2\.php$ somepage2.html [R=301,L] etc... Also, does it matter where in the conf file I place it (I assume in the same section as Alias)? DAve Link to comment https://forums.phpfreaks.com/topic/58735-redirect-instead-of-mod_rewrite/ Share on other sites More sharing options...
hackerkts Posted July 7, 2007 Share Posted July 7, 2007 I prefer using mod_rewrite than redirecting them to other pages, if I didn't forget redirect will give spiders some problems. Your .htaccess, you don't have to repeat putting this RewriteEngine On RewriteBase/ Link to comment https://forums.phpfreaks.com/topic/58735-redirect-instead-of-mod_rewrite/#findComment-291711 Share on other sites More sharing options...
dbrimlow Posted July 7, 2007 Author Share Posted July 7, 2007 Isn't it better to put it directly into the http.conf file? Link to comment https://forums.phpfreaks.com/topic/58735-redirect-instead-of-mod_rewrite/#findComment-291747 Share on other sites More sharing options...
hackerkts Posted July 7, 2007 Share Posted July 7, 2007 I'm not sure which is a better method, but I prefer using mod_rewrite. Link to comment https://forums.phpfreaks.com/topic/58735-redirect-instead-of-mod_rewrite/#findComment-291758 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.