Rewritting old URL’s to new
-
A couple of weeks ago I asked a question about how to redirect any requests for old URL’s to a new one. Unfortunately, the answers provided don’t seem to be what I am looking for when I attempted to get them to work.
So let me reword the question so hopefully someone can explain to me what to do.
Basically, I just moved my blog from https://www.chrisgonyea.com/blog/ to https://chrisgonyea.com/
I would like to setup some type of redirect so anytime someone tries to access a page at the old address gets redirect to the new address.
So for example:
1. User types in their browser: https://www.chrisgonyea.com/blog/archives/2004/12/17/firefox-nyt-ad/
2. .htaccess or whatever notices this address, and redirects it automatically to: https://chrisgonyea.com/archives/2004/12/17/firefox-nyt-ad/
Notice that the only difference in the links is the missing “blog” directory in the new URL.
Now I have to redirect EVERY single old URL to the new site
So is there an easy way to say “Anything trying to go to https://www.chrisgonyea.com/blog/*.* (or any sub-directories below that), .htaccess will take the entire structure of the URL after the blog directory and attach it to the end of https://chrisgonyea.com/”?
Another example:
1. https://www.chrisgonyea.com/blog/archives/2004/12/16/mastercard-sox/
2. .htaccess or whatever notices right away that this is an old URL. It takes the /archives/2004/12/16/mastercard-sox/ part and throws it on the new URL.
3. URL becomes https://chrisgonyea.com/archives/2004/12/16/mastercard-sox/
Any ideas?
- The topic ‘Rewritting old URL’s to new’ is closed to new replies.