I'm moving my blog to a new host and am changing the domain name and url structure of the site. Anyone know of a redirect script that can be used for this? Current url structure is http://oldsite/folder/name_of_blog_post. The new structure will be http://newsite/name_of_blog_post. How can i ensure t
-
I plan to redirect with the httaccess file. Also note that this a wordpress site. Maybe there is a plugin I can leverage?
-
Answer:
Here is the rewrite rule I use for such scenarios. RewriteEngine On RewriteCond %{HTTP_HOST} ^oldsite$ [NC] RewriteRule ^(.*)$ http://newsite$1 [R=301,L] I include a rewrite condition, but it isn't really necessary unless you want to handle multiple domains matched to multiple destinations.
Tristan Irwin at Quora Visit the source
Other answers
Most programming languages have redirection capabilities within them so it depends what language your site is build in. You could also opt do do this via Apache. Something along the lines of this, though I've not used Apache in a while so it's worth reading up on this more. RewriteEngine On RewriteRule ^[A-Za-z0-9-]+\/([A-Za-z0-9-]+)/?$ $1 [NC,L] You'll also want to make sure there's a 301 Permanently Moved on each page to the new page location, not sure if that's automatic with Apache Rewrite. This way the links appearing within Google, Yahoo, Bing will automatically redirect to the new site and also let these search engines know the content has a new home. More info on the 301 here: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2
David White
Related Q & A:
- Does anyone know what type of job you can get with a Japanese Major?Best solution by worldwidelearn.com
- Does anyone know of a good auction site besides EBAY?Best solution by Yahoo! Answers
- How can I ask facebook the permission for a new account?Best solution by Yahoo! Answers
- If I have a subscription to Seventeen and I'm moving out, how do I tell them my address has changed?Best solution by Yahoo! Answers
- Does anyone know of a safe site I can buy this from?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.