Forum Moderators: phranque

Message Too Old, No Replies

Mod Rewrite

How to capture requests for all asp pages and rewrite them to html

         

stephan99

11:43 pm on Aug 26, 2003 (gmt 0)

10+ Year Member



I redid a site from asp to html, and I am trying to figure out the best way to have all the spidered asp pages redirect to the new html pages ( or even just the index page )

Sould I use a mod rewrite and if so how do I do it, I tried a bunch of things but got server error 500

RewriteEngine on
RewriteBase /
RewriteRule [^.]*\.asp$ ^(.*)$ [site.com...] [NC,R]

Or would it be better to redo all the asp pages with a hyperlink to the index page that just say document has moved, so mayne some PR can be passed on?

Thanks in advance for your help.
Stephan

jdMorgan

12:22 am on Aug 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



stephan99,

Welcome to WebmasterWorld [webmasterworld.com]!

Rewrite <anything>.asp to <anything>.html
For use in top-level .htaccess:


RewriteEngine on
RewriteBase /
RewriteRule ^(.+)\.asp$ http://www.site.com/$1.html [R=301,L]

Ref: Introduction to mod_rewrite [webmasterworld.com]

Jim

stephan99

12:43 am on Aug 27, 2003 (gmt 0)

10+ Year Member


Thank you very much :[smilestopper]o)

Stephan