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
-
Question re: spammy internal links on site
Hi all, I have a blog (managed via WordPress) that seems to have built spammy internal links that were not created by us on our end. See "site:blog.execu-search.com" in Google search results. It seems to be a pharma-hack that's creating spammy links on our blog to random offers re: viagra, paxil, xenical, etc. When viewing "Security Issues", GSC doesn't state that the site has been infected and it seems like the site is in good health according to Google. Will anyone be able to provide any insight on the best necessary steps to take to remove these links and to run a check on my blog to see if it is in fact infected? Should all spammy internal links by disavowed? Here are a couple of my findings: When looking at "internal links" in GSC, I see a few mentions of these spammy links. When running a site crawl in Moz, I don't see any mention of these spammy links. The spammy links are leading to a 404 page. However, it appears some of the cached version in Google are still displaying the page. Please lmk. Any insight would be much appreciated. Thanks all! Best,
Technical SEO | | hdeg
Sung0 -
Migration to New Domain - 301 Redirect Questions
My client is migrating their site to a new domain. I just did a big redesign, including URL structure change, and 301s from old URLs to new URLs. Now they want a new name, so we're moving forward with a new domain name. However, we're going to keep the site on the current domain while we ease customers into the new name. During that time, I'm going to be building links to the new domain name and 301 Redirecting that new one to the current domain name. Then, once we migrate the site to the new domain name, I'm then going to redirect the current domain name to the new domain name. So, my question(s) is/are: Is the above process the best way to use 301 redirects to to build links to the new domain while we transition everything? Should I (or can I) do 3 redirects from the oldest URLs, to the current URLs then to the new URLs? General question... I can't seem to find this anywhere online, but what is the best practice for what order URLs should be in in the htaccess file? Thanks!
Technical SEO | | Kenny-King0 -
Rel canonical question
Hi, I have an e-commerce site hosted on Volusion currently the rel canonical link for the homepage points to www.store.com/default.asp. I spoke with the Volusion support people and they told me that whether the canonical link points to store.com/default.asp or store.com does not really matter as long as there is a canonical version. I thought this sounded odd, so looked at other websites hosted on volusion and some sites canonicalize to default.asp and others .com. (volusion.com canonicalizes to .com fwiw). The question is...I have a majority of my external links going to www.store.com , and since that page has default.asp as it canonical version, am I losing link juice from those incoming links? If so, should I change the canonical link? If I do what are the potential issues/penalties? Hopefully this question makes sense and thanks in advance.
Technical SEO | | IOSC0 -
How does this rank? - a page that is 301 redirected
How does a 301ed page rank in google? In google I searched for" ikea.ca" which is set up as a 301 redirect to www.ikea.com/ca/en and was surprised to see the url --> www.ikea.ca actually ranking. IKEA Canada <cite>ikea.ca/</cite>IKEA Featuring Scandinavian modern style furniture and accessories. Include storage options, lighting, decor products, kitchen appliances and beds. Bedroom - Kitchen - Living Room - IKEA North York
Technical SEO | | Morris770 -
Webmaster woes - should I re-direct or re-structure?
Hey guys, I'll get straight to the point - a small (growing) website I'm working on has a number links pointing to it from totally irrelevant sites (66, to be precise). These were built by an SEO company prior to me working on the site, and lead to an over-optimisation penalty for one keyword. This number doesn't sound large, but proportionally (to all other links), it is. It didn't used to be, but a lot of the links coming in have now 'died', and the domains they came from are now just parked. Anyway, I have managed to contact pretty much all the webmasters, and 27 of these links have been removed. Unfortunately - as I'm sure many people know all too well - a good handful of the contacted webmasters haven't replied, and the bad links still remain on their websites (either in-content or on links pages). I have decided to 'refresh' the website with some new (and better) content - providing much more information and a valuable resource. My question is - what should I do? Should I just replace the content on the existing pages (slightly altering the URL structure to match the topic more) and 301 the old URLs to the new ones? Or should I delete the pages and create new ones - thus making sure this particular section of the site isn't affected by any bad in-bound links? I'm more inclined to opt for the latter option, and 'start fresh' with the pages - so I know I've got total control over them, but wanted to get the opinion of the community before I made a decision. Thanks in advance for your responses! Nick
Technical SEO | | Danapollo0 -
301 Redirects
Hi, I ran the seomox link report and see that I have an entry for our home page (http://www.trophycentral.com/) and http://www.trophycentral.com/index.html. The index is shown with a 301 redirect. Does this mean that a redirect is already in place to http://www.trophycentral.com/? I want to ensure our traffic is not being split between the two urls, but not sure how to confirm this. Thanks! <colgroup><col width="294"></colgroup><colgroup><col width="81"></colgroup><colgroup><col width="80"></colgroup><colgroup><col width="77"></colgroup><colgroup><col width="214"></colgroup>
Technical SEO | | trophycentraltrophiesandawards
| URL | HTTP Status | Total Links | Page Authority | Number of Linking Root Domains |
| http://www.trophycentral.com/ | 200 | 5746 | 53 | 244 |
| http://www.trophycentral.com/index.html | 301 | 5123 | 42 | 4 |1 -
Craw Diagnostics Questions
SEO Moz is reporting that I have 50+ pages with a duplicate content issue based on this URL: http://www. f r e d aldous.co.uk/art-shop/art-supplies/art-canvas.html?manufacturer=178 But I have included this tag in the source: rel="canonical" href="http://www.f r e daldous.co.uk/art-shop/art-supplies/art-canvas.html"/> (I have purposefully added white space to the URLs in this message as I'm not sure about the rules for posting links here) I though this "canonical" tag prevented the duplicate content being indexed? is the reporting by SEOMoz wrong or being over cautious?
Technical SEO | | niallfred0 -
Robots.txt questions...
All, My site is rather complicated, but I will try to break down my question as simply as possible. I have a robots.txt document in the root level of my site to disallow robot access to /_system/, my CMS. This looks like this: # /robots.txt file for http://webcrawler.com/
Technical SEO | | Horizon
# mail webmaster@webcrawler.com for constructive criticism **User-agent: ***
Disallow: /_system/ I have another robots.txt file in another level down, which is my holiday database - www.mysite.com/holiday-database/ - this is to disallow access to /holiday-database/ControlPanel/, my database CMS. This looks like this: **User-agent: ***
Disallow: /ControlPanel/ Am I correct in thinking that this file must also be in the root level, and not in the /holiday-database/ level? If so, should my new robots.txt file look like this: # /robots.txt file for http://webcrawler.com/
# mail webmaster@webcrawler.com for constructive criticism **User-agent: ***
Disallow: /_system/
Disallow: /holiday-database/ControlPanel/ Or, like this: # /robots.txt file for http://webcrawler.com/
# mail webmaster@webcrawler.com for constructive criticism **User-agent: ***
Disallow: /_system/
Disallow: /ControlPanel/ Thanks in advance. Matt0