.htaccess when integrating one website into another
-
My client would like to integrate one of it's smaller websites into its main website.
I've identified around 20 pages which I'd like to 301 redirect to specific pages on the main website, and this is simple enough.
The problem I have is that I am not sure how I can then put a catch-all to redirect all other pages on the site to the homepage of the main website.
I'd originally though something like this would work:
redirect 301 / http://www.mainwebsite.com/ (catch-all)
redirect 301 /about.asp http://www.mainwebsite.com/about (specific redirect 1)
redirect 301 /latest.asp http://www.mainwebsite.com/news (specific redirect 1)
etc.Any ideas?
-
Just had a eureka moment with the issue as above!
All that was needed was a .htaccess on the old site like this:
Redirect 301 / http://www.newsite.com/
This attempts to pass a user/crawler to the equivalent page on the new site (which doesn't exist), so this is then handled with a .htaccess on the new site which then redirects to the new versions of those pages:
Redirect 301 /about.asp http://www.newwebsite.com/about (specific redirect 1) Redirect 301 /latest.asp http://www.newwebsite.com/news (specific redirect 1)
Simples!
-
You should be able to achieve what you want by redirecting 404s. You can do this by adding the following to your .htaccess
ErrorDocument 404 /homepage.html
Where homepage.html is the address of your homepage.
What would be better really though is to land them on a an actual 404 page that explains that the page doesn't exist anymore and gives them options of where to go next. Include direct links to the most popular content on the site.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Set Up htaccess File
Looking for expert help (willing to pay) to set up a proper htaccess file. I'm having an issue as the site has a subdomain at secure.domain.com and has php extensions there. I tried a couple recommended code sets but it seems to be a mess. The site is working properly but this may be causing rankings issues. It's coded in pure HTML and PHP, no Wordpress stuff.
Technical SEO | | execubob
The delete www causes the secure side to fail. The delete html extensions causes the php extensions to fail.0 -
How To Cleanup the Google Index After a Website Has Been HACKED
We have a client whose website was hacked, and some troll created thousands of viagra pages, which were all indexed by Google. See the screenshot for an example. The site has been cleaned up completely, but I wanted to know if anyone can weigh in on how we can cleanup the Google index. Are there extra steps we should take? So far we have gone into webmaster tools and submitted a new site map. ^802D799E5372F02797BE19290D8987F3E248DCA6656F8D9BF6^pimgpsh_fullsize_distr.png
Technical SEO | | yoursearchteam0 -
Website analysis for SEO
Hi, We have been trying to gain ranking for 7 keywords for a year now but have been unsuccessful We are not sure where we are going wrong, if someone could please help us out, we are happy to pay for your time.
Technical SEO | | mframing0 -
Is there any SEO benefit to pulling a picture from another website and linking to it from a blog?
For example, if blog.mountainmedia.com were to link a product picture directly to mountainmedia.com. Would this be considered a high quality backlink?
Technical SEO | | MountainMedia0 -
Crawl errors which ones should i sort out
Hi, just had my website updated to joomla 3.0 and i have around 4000 urls not found. now i have been told i need to redirect these but i would just like to check on here to make sure i am doing the right thing and the advice i have been given is not correct. I have been told these errors are the reason for the drop in rankings. I need to know if i should redirect all of these 4,000 urls or only the ones that are being linked to from outside of the site. I think about 3,000 of these have no links from outside of the site, but if i do not redirect them all then i am going to keep getting the error messages. around 2,000 of these url not found are from the last time we updated the site which was a couple of years ago and i thought they would have died off now. any advice on what i should do would be great
Technical SEO | | ClaireH-1848860 -
Sudden drop in website ranking
Since past 2 week my website www.micromaxtablet.in is experiencing sudden drops in the site ranking. I can understand this regression in the site ranking is not because of Goggle Panda update, and their is some other reason. Kindly let me know what could be the other possibilities, and plz also suggest how to get it fixed. Keyword for which the site had the best rankings (in top 3) was "micromax tablet". Now it shows on the second page in the google search and to make it worse, it's losing its position almost every second day.
Technical SEO | | nishant9110 -
Looking for joomla expert how do i find one
Hi, I am looking for a joomla expert to look at our site and help speed it up and possibly upgrade the site, now i do remember coming across a site on here where you can put out a tender for joomla programmers but i cannot find it, can anyone please help me with information of how to advertise what we require and what site we should go to. many thanks
Technical SEO | | ClaireH-1848860 -
Multi Language websites!
Hello, What is the best way for a website to have more languages? For example www.site.com is in english BUT the content will be translated in other 4 languages .es .it .fr .de . Should i buy 4 diferent domains www.site1.es www.site2.it etc... or create folders like site.com/es/ site.com/it etc OR create subdomains es.site.com Few months ago i was 100% sure..to go and buy diferent domains then to create diferent content on that languages..but now..i am not so sure. Thank you very much for your help!
Technical SEO | | willyg0