ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

301 redirect from static site to EE site

January 28, 2012 8:08pm

Subscribe [3]
  • #1 / Jan 28, 2012 8:08pm

    devilslayer

    27 posts

    I am planning to move a static site to Expression Engine. 

    The existing site is fairly well ranked with Google and other search engines and I don’t want the owner to lose his existing page rank.  I know I need to use 301 redirects probably utilising a .htaccess file.

    As the new site will use the same domain names as the old site, what is the best way to achieve this?

    i.e If the old static page was:

    http://www.mydomain.com/0-1page1.html

    and the new page was:

    http://www.mydomain.com/my-keyword/

    Many thanks for your help.

  • #2 / Jan 29, 2012 6:11pm

    Rob Allen

    3118 posts

    Definately use 301 redirects, the basic syntax for each page you want to redirect is…

    Redirect 301 /0-1page1.html http://www.mydomain.com/my-keyword/

  • #3 / Jan 29, 2012 6:15pm

    Dan Decker

    7338 posts

    Hi devilslayer,

    Rob is on point here. You will certainly want to establish 301 redirects for all of your old content. That will tell the search engines that your content now permanently lives at the new URL and they will update the searches accordingly. Is there anything else we can assist you with?

    Cheers!

  • #4 / Jan 30, 2012 11:17am

    Matt Powell

    42 posts

    One other small thing to add, if you’re using index.php removal be careful your 301s play nicely with the rest of the htaccess rules.

    This has worked for me:

    RewriteEngine On 
    
    RewriteRule ^old-url <a href="http://www.domain.com/new-url">http://www.domain.com/new-url</a> [L,R=301]
    
    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)$ /index.php/$1 [L]

    cheers

  • #5 / Jan 30, 2012 3:45pm

    devilslayer

    27 posts

    Do I need to add all the URL’s into the .htaccess file?

    Redirect 301 /0-1page1.html <a href="http://www.mydomain.com/my-keyword/">http://www.mydomain.com/my-keyword/</a>
    Redirect 301 /0-2page2.html <a href="http://www.mydomain.com/my-keyword2/">http://www.mydomain.com/my-keyword2/</a>
  • #6 / Jan 30, 2012 3:55pm

    Matt Powell

    42 posts

    Yep, each one on a new line as you have it (for readability if nothing else)

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases