I am changing my website from a dynamic CMS-system (Umbraco) to a static classic .HTML. It is the on the same domain, but the URL will change.
Example: The URL is changing from:
www.example.com/information
To:
www.example.com/info.html
My question is:
What is the best way to redirect while keeping the best SEO page rank.
I am thinking about 301 redirect through .htaccess
, but I am not sure if I should redirect my new to .html urls to the old dynamic …/example – or the other way?
Or maybe there is a different better way?
I do have a fine 404.
Also I need the right redirect code for .htaccess
– if that’s the right way.
I hope you guys can help me out.
I haven’t try anything out yet, because I don’t wanna do 301 before the site go live.
2
Answers
White
I finally got my page ready to go live, and i changed all my new URLS to the same name as the old URL, just with a .html extension - as u said. After that i used:
And it works fine.
I do have a question about if a "RewriteRule ^(.*).html$ /$1 [L,R=301]" would be better? I mean both "/page.html" and "/page/" works, and this could mess with my former SEO ranking?
Also: what do u think of this:
And by the way. Do you use "page.html" or just "/page" in your href to prevent the .html showing?
//MM
You need to implement 301 redirects from the old URL to the new URL in order to preserve SEO and ensure that any "old" links that have been bookmarked or linked to from other websites still work.
Exactly how you implement the 301 redirect (either in your server-side script or in
.htaccess
) does not really matter. However, if you are moving to an entirely static site then.htaccess
is likely the only option you have.You need to redirect from the "old" URLs to the "new" URLs that you are using/linking to on the new site. (It makes no sense to redirect the other way as that would just break everything!)
You can probably just use the simple mod_alias
Redirect
directive.For example, to 301 redirect from
/information
to/info.html
you could do the following:Bear in mind that 301 redirects are cached persistently by the browser. To prevent caching issues it is advisable to test first with a 302 (temporary) redirect.
Have you considered keeping the same URLs? This would obviously negate the need for implementing redirects. You could employ URL-rewriting if the underlying file is called
info.html
. For example, using mod_rewrite:The above would internally rewrite a request for
/information
toinfo.html
. The user only sees/information
in the browser address bar, butinfo.html
is served from your site.Taking this further, it would be easier if the new "file" is simply the same as the old URL, just with a
.html
extension. For example, the URL is/information
and the underlying file isinformation.html
. You can then use a single rule to rewrite all your URLs. For example:The above assumes the old URLs do not contain additional slashes (ie. consist of a single path segment. In other words, all files are in the document root) and do not contain dots.