301 Re Direct Question for www
-
Can smeone check this code to make sure it is right so thaqt my site uses www always.
RewriteCond %{HTTP_HOST} ^exercisebiology.com [NC]
RewriteRule ^(.*)$ http://www.exercisebiology.com/$1 [R=301,L]
I had the hostgators customer service personnel perform this. But I cannot get it to redirect. But he says it works.
-
Yea That's what I think.
I tried adding the traoling slash with 301 redirecet, but it didn't work.
RewriteEngine On
RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(.)/$ RewriteRule ^(.)$ http://www.exercisebiology.com/$1/ [L,R=301]This was the code I used. Can you tell me what is wrong please?
-
Does your site use the "index.php" version of the page with parameters to handle logins? In that case, you can't 301-redirect the page across the board. You'd have to do it selectively (only for the version with no parameters), and that's going to take custom-coding. You'd probably be better off with a canonical tag, in that situation - it would keep Google from indexing the variants (including the login pages, which have no search value).
-
Thanks!
1. Can you show me how to do a redirect for for http://www.exercisebiology.comto http://www.exercisebiology.com/ I want to add the trailing slash.
2. Also how to redirect from http://www.exercisebiology.com/index.php
to http://www.exercisebiology.com/.
When I tried to redirect the index.php last time, I couldn't login to the forums. Everytime when someone tries to login to my forums, it takes them the to the home page. I did it through the hostgator CP. I am thinking someone could help me here.
Thank you so much!
-
I see you have canonical tags in place. Considering that, I would suggest you are good. No need to setup any of those redirects. Canonical tags are in essence sort of 301's anyways, so you are all set.
-
Thank you. Worked like a charm.
Since we are on the topic, do you know how I can put a redirect for these pages: For every article, I have a few of these duplicate titles. I removed the pagination tags so it wont give out any more P's and N's But I am guessing I should do redirect. Should I ? **Here is an example of one article and the URL's with page numbers. **
/index.php/site/articles/does_testosterone_supplement_tribulus_work//index.php/site/articles/does_testosterone_supplement_tribulus_work/N12//index.php/site/articles/does_testosterone_supplement_tribulus_work/N1564//index.php/site/articles/does_testosterone_supplement_tribulus_work/N1568//index.php/site/articles/does_testosterone_supplement_tribulus_work/N1572/P12//index.php/site/articles/does_testosterone_supplement_tribulus_work/N1572/P18//index.php/site/articles/does_testosterone_supplement_tribulus_work/N1572/P6//index.php/site/articles/does_testosterone_supplement_tribulus_work/N16//index.php/site/articles/does_testosterone_supplement_tribulus_work/N4/P18//index.php/site/articles/does_testosterone_supplement_tribulus_work/N4/P6//index.php/site/articles/does_testosterone_supplement_tribulus_work/N8/P12//index.php/site/articles/does_testosterone_supplement_tribulus_work/N8/P6//index.php/site/articles/does_testosterone_supplement_tribulus_work/P12/N1572//index.php/site/articles/does_testosterone_supplement_tribulus_work/P12/N8//index.php/site/articles/does_testosterone_supplement_tribulus_work/P18/N1572//index.php/site/articles/does_testosterone_supplement_tribulus_work/P18/N4//index.php/site/articles/does_testosterone_supplement_tribulus_work/P18/N8//index.php/site/articles/does_testosterone_supplement_tribulus_work/P6/N1572//index.php/site/articles/does_testosterone_supplement_tribulus_work/P6/N4//index.php/site/articles/does_testosterone_supplement_tribulus_work/P6/N8/
-
Try this in the .htaccess file. It should work fine for sure.
You don't need to manually add your website name.<code class="htaccess" title="in your .htaccess file">RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]</code>
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
-
Google Enterprise Search Questions
Hi Everybody, A client has asked me to take a look at Google Enterprise Search for them. It has been a few years since I last fooled around with implementing a Google search box on a website, and that was the free version which included off-site results in the results. This appears to be the main page describing the paid product: http://www.google.com/enterprise/search/ I have three questions: The search testing function on the above page doesn't seem to be working. I'm typing in a URL and search term, as prompted, and the page is simply refreshing. It never provides me an example set of results. Is it working for you? This client has a moderately large e-commerce site (about 200 products). Have you implemented Google enterprise search on such a site and are you happy with its performance? The goal here is to let users search for a topic and be returned both product and informational pages. How well does this tool do this? Am I going to need to know any special types of coding (beyond html/css) to implement this? If so, what are they? If you have experience with this product, I would surely appreciate your feedback. Thank you!
Technical SEO | | MiriamEllis0 -
301 redirect after penalty to domain which currently 301 to the penalised domain
Hello all, As I have mentioned in another Q&A, one of our new clients got hit by manual penalty. I checked their link profile and there was a lot of black hat involved. Long story sort, I submitted a reconsiderationr equest which was not enough as it seems 99,9% of his links are bad links. We took the decision to move a newly launched web site from www.websitename.com to www.website-name.com with the latter being an old domain name with good authority and clean link profile. The problem is that at the moment the www.website-name.com is set to 301 redirect to www.websitename.com and what we want to do now is take the web site off www.websitename.com and launch (not 301 as we dont want to pass the penalty to the clean domain) it to www.website-name.com. What is the best practise for this particular case and are there any things i should pay attention to? I would appreciate your advise!
Technical SEO | | artdivision0 -
Schema Address Question
I have a local business with a contact page that I want to add schema markup to. However, I was wondering if having the address with schema info on the contact page instead of the home page has any adverse effects on the rich snippet showing up in search. There's no logical place to add schema for a local business on the home page, so having it on the contact page—not in the footer or sidebar—is the only option.
Technical SEO | | DLaw0 -
301 redirectmatch
I think I'm starting to loss my mind. I have worked with regex before with very little problems how with my redirects nothing appears to be working. A little guidance is needed! The Low down I have a site with Joomla CMS backend. The site is undergoing and SEO overhaul I was simple hoping to use a 301 redirect o these old pages that are now a causing 404's The addresses /index.php?option=com_content&view=article&id=46&Itemid=53_blank /shop/product.php?id_product=11 I have tried the following redirects but no avail RedirectMatch 301 ^/shop/product.php?id_product=11$ http://www.nomitang.com/index.php/en/vm_getaway_w this does not work at all if I remove the ?.....ending then I can simply redirect the product page but this is not what we need. Why does RedirectMatch not register anything after the "?"? I also tried this RewriteCond %{HTTP_HOST} ?option=com_content&view=article&id=46&Itemid=53_blank [NC]
Technical SEO | | Stefan-Thorpe
RewriteRule ^(.*)$ http://www.nomitang.com/ [R=301,L] But this also didn't work. Please could someone tell me how to redirect these url's and how to deal with the extrension Thanks Stefan0 -
Quick Seo question regarding 301 redirect
Hi everyone and thank you for showing interested in my problem and for helping me out with this easy thing i have going on Here is how it puts out : I have 2 websites, same niche, mostly same keywords. Site #1 holding strong on google #2 ranking for months now. Site #2 was holding strong in google top 10 rankings until 2 weeks ago when it got sandboxed for some reason I want to use a 301 permanent redirect from Site #2 to Site #1 to pass all the link juice onto Site #1 and hopefully beat the #1 spot The question: Will this affect Site #1 is anyway, considering Site #2 is in somehow sandbox ( i assume that, since he dropped more then 70 positions over night ) Is thins a good think to do or i risk damaging Site #1 by doing this ? Thanks allot in advance. Best regards,
Technical SEO | | caw_ro
Trinca Alexandru0 -
Google SERPs and NoIndex directives.
We have pages that have been added to robots.txt as url patterns in DisAllow. Also, we have the meta noindex tags on the pages themselves. But we are finding the pages in index. I don't think they are higher up in the rankings and they don't have any descriptions, any previews or any cached pages. Why does Google show these pages? Could it be due to internal or external linking?
Technical SEO | | gaganc0 -
Is my non-www domain working
I believe we may have an issue with out domains and links which is causing our seo to suffer. As far as I'm aware, our non-www domain is being treated as a different domain name. Open Site explorer returns different information for each one. However, when I go to the non-www domain in my browser (I have to force it using the http as otherwise the browser auto inserts the www) my browser returns a page cannot be found. But there may be a chance this is actually an issue with the server we access the internet via at work. I need to establish 100% beyond all doubt that our non-www domain is not working. This is the www: http://www.jetbookingdirect.com/ This is the non-www: http://jetbookingdirect.com/ If it is definitely not working, is the right thing to do to ask my web host to setup a 301 redirect? Further, I thought redirects could only point to one address. If we 301 redirect, if someone accesses a specific page via the non-www domain, does it then take them to the correct page? Also, is it safe to say that our non-www domain not working has affected our SEO, and if we fix it, will it improve things for us? Thank you so much for clarification on this issue.
Technical SEO | | JetBookMike0 -
Question concerning a 302 Redirect
Hi! I've already done some research on redirects, but I still have a question concerning a 302 redirect implemented at the homepage of a website. The Website www.domainA.com has a 302 redirect to www.domainA.com/content/.... Also all subsequent pages have the /content/ directory in their URLs: e.g domainA.com/content/products First thing I was wondering about, was the use of a redirect to a new site using an additional directory /content/... Why would anyone do this? Would it be enough to replace the 302 with a 301 redirect, or would you recommend to change the entire structure and eliminate this /content/ directory? The most logical structure would be www.domainA.com/products/.., and not www.domainA.com/content/products, right? Second thing: Given that 302 means temporary redirect, what are the actual implications when redirecting from domainA.com to domainA.com/content? I've heard that 302 redirects don't pass linkjuice and are detrimental for the site's rankings... What are the actual implications concerning the example above (302 redirect from domainA.com to domainA.com/content ? Would be great to get some advice about the first problem and maybe some insights about the second one concerning 302s in general. Thanks in advance! Cheers, Chris
Technical SEO | | adwordize0