Htaccess help... I moved my blog from a seperate domain to newdomain.com/blog
-
Hi,
I need help with my htaccess file, I've been told.
I moved a blog i had hosted somewhere else to a directory on my ecommerce site. I was told i would need to write something to go in the htaccess file so the sites would not become duplicate content, but I'm a novice and have no idea how to write that code.
blog moved from www.whosyourmoondoggie.com to www.moondoggieinc.com/blog
Please help, or direct me to the right tutorial
Thanks!
KristyO
-
found this
RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !newdomain.com$ [NC] RewriteRule ^(.*)$ http://www.newdomain.com/$1 [L,R=301]
and it worked, thank you guys for your help though!
-
When I put in your code I get a 500 error? and if I put in JayD's code the site comes back up but there's not a visible redirect.
I know this sounds sill but I'm putting this into the htaccess of the old domain correct?
Should i be getting a 500 error or be seeing a visible redirect when i go to the address?
Thanks KO
-
Thank you everyone!
-
Hi Kristy
If you want to move old domain to the new domain you should do a 301 moved permanently redirect.
RewriteEngine On
RewriteBase /RewriteCond %{HTTP_HOST} !www.whosyourmoondoggie.com$ [NC]
RewriteRule ^(.*)$ http://www.moondoggieinc.com/blog/$1 [L,R=301]
After adding this code search engines and users will be automatically redirected to the new domain and all information related to that domain will transfer in new domain. One of the biggest advantage is that your page rank, link juice will also transfer to new domain. Your website can be accessed with www.domain.com and domain.com. So you can easily solve duplicate content error with this code.
-
Hi Kristy, If that does not work call my office in the morning and ask for CRIS... I WILL INSTRUCT HIM TO HELP YOU..
BEST,
TOM
972-382-3241
-
This should be close. No warranties!
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.whosyourmoondoggie.com
RewriteRule (.*) http://www.moondoggieinc.com/blog/$1 [R=301,L]
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
-
Redirect Process for Moving a Blog
Hi, I've read several articles about the correct process for moving a blog from a subdomain to the main root domain but am not quite 100% sure as to what to do in our scenario. They were hosting their blog on Hubspot which puts the blog on a sub-domain "blog.rootdomain.com". Realizing it isn't benefiting the main website for SEO they want to move it to the main website. I understand we have to redirect the Hubspot "blog." pages to the new "rootdomain.com/blog" pages but when transferred over (it's a WordPress site) it shows the dates. So, the URL is "rootdomain.com/blog/year/month/title". They want to remove the date. Does that mean the URL must be re-written then redirected so that there's no date showing? There's over 300 posts which will have to be redirected from the Hubspot URLs. Is there a way to avoid setting up the second redirect to remove the dates or make it easier so it isn't one page at a time?
Technical SEO | | Flock.Media0 -
When to use mod rewrite / canonical / 301 redirect
Hello, I have taken over the management of a site which has a big problem with duplicate content. The duplicate content is caused by two things: Upper and lower case urls e.g: www.mysite.com/blog and www.mysite.com/Blog The other reason is the use of product filters / pagination which mean you can get to the same 'page' via different filters. The filters generate separate URLs. http://www.mysite.com/casestudy
Technical SEO | | Barques-Design
http://www.mysite.com/casestudy/filter?page=1
http://www.mysite.com/casestudy/filter?solution=0&page=1
http://www.mysite.com/casestudy?page=1
http://www.cpio.co.uk/casestudy/filter?solution=0" Am I right to assume that for the case sensitive URLs I should use a 301 redirect because I only want the lower page to be shown? For the issue with dynamic URLs should we implement a mod-rewrite and 301 to one page? Any advice would be greatly appreciated.
Mat0 -
Domain redirect
Recently we launched a site under a new domain, the site is doing well under the URL. Client calls me today and would like to have another domain he owns point to the new site. The domain he has has no history and no content. He is under the impression that people are looking for him by typing in www.domainxyz.com. I attempted to explain otherwise to him, but I lost. Question, what are the drawbacks of taking this domin and doing a perm redirect via . Httpaccess file?
Technical SEO | | VanadiumInteractive0 -
Htaccess rewrites
We’re using wordpress, and we have the following in the .htaccess: BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] END WordPress We have a URL like http://subdomain.example.com/select-a-card/?q=fuel, and I want to rewrite it so that it becomes http://subdomain.example.com/fuel-card/ What do I need to add to the htaccess to do this?? Thanks,
Technical SEO | | AndrewAkesson0 -
Difference between changing sitename.com and sitename.com/ info?
my crawl is showing duplicate content between my sitename.com and sitename.com/ i remember the beginner's guide referencing that these are separate websites - but how do you modify their title info on a wordpress.org blog, and what's the difference between getting to these two sites? also, are there any wordpress.org plugins to mass fix meta descriptions, and not founds, retroactively? i have all in one seo, but not sure how to apply the changes retroactively. a new crawl shows too many to fix manually (89+) missing metas, mostly due to multiple pages on categories, etc. and other time consuming, tedious generations.. any help appreciated, thanks
Technical SEO | | prospects0 -
Sub Domain vs. New Root Domain for New Brand
Would you recommend a new brand be placed as a subdomain to the existing parent company or create a separate root domain for this new brand?
Technical SEO | | ScratchMM0 -
Video Sitemaps <video:content_loc>and<video:player_loc></video:player_loc></video:content_loc>
Hi guys, If I'm creating a video sitemap do I need to use both: video:content_locandvideo:player_loc</video:player_loc></video:content_loc> Or could I just use video:content_loc?</video:content_loc> Thanks
Technical SEO | | Tug-Agency0 -
Multiple Domains, Same IP address, redirecting to preferred domain (301) -site is still indexed under wrong domains
Due to acquisitions over time and the merging of many microsites into one major site, we currently have 20+ TLD's pointing to the same IP address as our "preferred domain:" for our consolidated website http://goo.gl/gH33w. They are all set up as 301 redirects on apache - including both the www and non www versions. When we launched this consolidated website, (April 2010) we accidentally left the settings of our site open to accept any of our domains on the same IP. This was later fixed but unfortunately Google indexed our site under multiple of these URL's (ignoring the redirects) using the same content from our main website but swapping out the domain. We added some additional redirects on apache to redirect these individual pages pages indexed under the wrong domain to the same page under our main domain http://goo.gl/gH33w. This seemed to help resolve the issue and moved hundreds of pages off the index. However, in December of 2010 we made significant changes in our external dns for our ip addresses and now since December, we see pages indexed under these redirecting domains on the rise again. If you do a search query of : site:laboratoryid.com you will see a few hundred examples of pages indexed under the wrong domain. When you click on the link, it does redirect to the same page but under the preferred domain. So the redirect is working and has been confirmed as 301. But for some reason Google continues to crawl our site and index under this incorrect domains. Why is this? Is there a setting we are missing? These domain level and page level redirects should be decreasing the pages being indexed under the wrong domain but it appears it is doing the reverse. All of these old domains currently point to our production IP address where are preferred domain is also pointing. Could this be the issue? None of the pages indexed today are from the old version of these sites. They only seem to be the new content from the new site but not under the preferred domain. Any insight would be much appreciated because we have tried many things without success to get this resolved.
Technical SEO | | sboelter0