views:

350

answers:

1

I am updating an old asp site to cakephp - the old site has various listings on google based on the old "filename.asp" urls - I'd like to put Redirect 301s in the htaccess file to try and hang on to those search results (most of the pages have a complementing page on the new site), but something appears to be going wrong. htaccess as follows (excluding standard cake stuff). What am I doing wrong?

Redirect 301 contact.asp /contact    
Redirect 301 portfolio.asp /portfolio-design-web    
Redirect 301 webhosting.asp /

I've tried with the htaccess in the root directory, and webroot but it should just work wherever, no?

--

fixed it using mod_rewrite, following rules inside .htaccess on webroot work:

RewriteRule ^contact.asp$ /contactos/ [R=301,L]
+1  A: 

Try modifying app/webroot/.htaccess like so:

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteRule ^contact.asp$    /contact              [R=301,L] 
    RewriteRule ^portfolio.asp$  /portfolio-design-web [R=301,L] 
    RewriteRule ^webhosting.asp$ /                     [R=301,L] 

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
deizel
Yep, literally just tried that! But, ticked for correct solution, thanks.
danp