Code for redirect
-
What is the code to redirect
www.xyz.com/abc where abc is a folder to www.xyz.com/abc.html
-
Hi Atul
This should help http://www.seomoz.org/img/upload/Cheat%20Sheet%20-%20301.png
Here is the full PDF version of Developer's SEO cheat sheet. I found it very useful when dealing with technical SEO issues.
-
I am doing 301 direct using apache server.
what should i write in .htaccess file
-
Hi Atul,
Tom is right - it depends on the server, but the linked-to post should tell you how to do this. If you are using a Microsoft IIS server, this post can help with those redirects.
Jane
-
Hi Atul
That would depend on what type of redirection you're after, 301, 302 and the type of server you are using Apache or ISS. There is a nice post here explaining redirections in detail. It should answer your question.
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
-
Do you still loose 15% of value of inbound links when you redirect your site from http to https (so all inbound links to http are being redirected to https version)?
I know when you redesign your on website, you loose about 15% internally due to the 301 redirects (see moz article: https://moz.com/blog/accidental-seo-tests-how-301-redirects-are-likely-impacting-your-brand), but I'm wondering if that also applies to value of inbound links when you redirect your http://www.sitename.com to https://www.sitename.com. I appreciate your help!
Technical SEO | | JBMediaGroup0 -
Is my knowledge graph code wrong?
I inserted the Knowledge Graph code on our site last week and am still not seeing the knowledge graph in our search results. Is something incorrect with my code? <script type="<a class="attribute-value">application/ld+json</a>"> { "@context" : "http://schema.org", "@type" : "Organization", "name" : "IssueTrak", "url" : "http://www.issuetrak.com/", "sameAs" : [ "http://www.facebook.com/issuetrak", "http://www.twitter.com/issuetrak", "http://plus.google.com/google.com/+Issuetrak"] } script>head> I suspect it is the alignment of the "{" and "}" but others in the company say that doesn't matter. Any other explanations for why the KG isn't showing in the results? Thanks I did test it with Google's Structured Data Testing Tool and got the "all's good."
Technical SEO | | Nobody15969167212220 -
IP redirect possible SEO issues?
Hi I help manage a small eCommerce business that sells worldwide. We currently have 4 stores www.tidy-books.com (US site) www.tidy-books.co.uk (UK) www.tidy-books.eu (EU) www.tidy-bboks.com.au (AU) We have auto redirect based on the country of your IP. The .com is the route address though. Currently I have decided to focus all my energies with link building etc on .com as it seems to carry the most weight and being a very small team we don't have the resources for separate campaigns for all websites at the moment. Whilst I've done on site SEO with country in mind i.e for US kids instead of children. I'm just wondering if you can see any pitfalls in this approach, Ideally I would like to have a team focus on each store separately and have them as separate domains but with the IP redirect we at least rank well in Google for the .com and the customers gets sent to the relevant store. Any thoughts would be great
Technical SEO | | tidybooks0 -
How long should you keep 301 redirects?
Hi, Back in 2009 I decided to update an older site from .htm and .shtml to .php. In order to minimize the impact I would go in every month and do a 301 redirect on the .shtml page to the new .php page. So I have many that range from 2009 through 2010. I had left the old 301's because I felt they would only be used if needed but I would think I should clean up my .htaccess by removing the old 301 redirects if they are not needed. How long should you keep this type of 301 redirect? Thanks!
Technical SEO | | Force70 -
Portfolio website: reciprocal backlinks and redirects
My company specializes in website design and development, and as such, the portfolio section on our website has lots of links to websites we've built. Generally, the way that we do this is that our portfolio sections links to URLs with a naming scheme as follows: http://ourcompany.com/client1 which is either a redirect to http://client1.com if the site is still up, or a version hosted on our website (http://ourcompany.com/client1) if the client is no longer hosting their site. In addition, most of our client sites contain a reciprocal link back to ourcompany.com, usually with the text "Website design and development by OurCompany". I have two questions about this arrangement: Might the reciprocal backlinks from the client sites be affecting the SEO results for ourcompany.com? I know that reciprocal backlinks can be occasionally problematic. If I do a search for "site:ourcompany.com", I'll get results for all of the client sites that we're hosting at http://ourcompany.com/client1, because I haven't excluded them in robots.txt. Of course, the content of these sites has little to do with that of our company, because we have a diverse array of clients and none of them do web design and development (which is the content focus of our site). Might this seemingly unrelated content be affecting our results? Should the client sites be excluded in robots.txt or via nofollow? Thanks very much!
Technical SEO | | fdepino0 -
301 Redirection of entire section to the homepage
Hi Guys, So here's the deal. Let's say I have a site at mysite.com/ which talks about tomatoes, and I also have a subsection that talks about potatoes at mysite.com/potatoes I want to stop providing information about potatoes altogether so i'm thinking about doing a 301 redirection from all of the pages at mysite.com/potatoes(.*) to the home page. The thing is, mysite.com/potatoes actually has a great page authority (3475 links from 145 domains) so I really don't wan to lose all that juice... Here are my questions: Will the links be added to the ones i have for the homepage already? Since my home page and my /potatoes section ranked for 2 different subjects, how is this transfer going to affect my rankings for the homepage? will it now also rank for both tomatoes AND potatoes? How much time does it usually take for google to recognize the 301 and pass the link juice? Any other tips on optimizing this process? Thank you for your time! -francois
Technical SEO | | nyakim0 -
Is a 302 redirect the correct redirect from a root URL to a detail page?
Hi guys The widely followed SEO best practice is that 301 redirects should be used instead of 302 redirects when it is a permanent redirect that is required. Matt Cutts said last year that 302 redirects should "only" be used for temporary redirects. http://www.seomoz.org/blog/whiteboard-interview-googles-matt-cutts-on-redirects-trust-more For a site that I am looking at the SEO Moz Crawll Diagnostics tool lists as an issue that the URL / redirects to www.abc.com/Pages/default.aspx with a 302 redirect. On further searching I found that on a Google Support forum (http://www.google.com/support/forum/p/Webmasters/thread?tid=276539078ba67f48&hl=en) that a Google Employee had said "For what it's worth, a 302 redirect is the correct redirect from a root URL to a detail page (such as from "/" to "/sites/bursa/"). This is one of the few situations where a 302 redirect is preferred over a 301 redirect." Can anyone confirm if it is the case that "a 302 redirect is the correct redirect from a root URL to a detail page"? And if so why as I haven't found an explanation. If it is the correct best practice then should redirects of this nature be removed from displaying as issues in the SEO Moz Crawll Diagnostics tool Thanks for your help
Technical SEO | | CPU0 -
Https redirect
Hi there, a client of mine is asking me if Google would penalize to redirect from all the http urls to https (they want to change the security protocol). I assume it is going to work as a classic 301, right? so they might lose some authority in they way, but I am not 100% sure. Can anyone confirm this? does anyone has a similar experience? thanks a lot!
Technical SEO | | elisainteractive0