Redirection in .htaccess
-
Hi All,
The problem is with the .htaccess file I have written 301 redirection code for Apache server but once I upload .htaccess file from ftp the website is throwing 500 error. Please help as I'm new to the redirection files.
-
I uploaded file named .htaccess
-
Hi Leonie Kramer,
Thanks for the solution I removed ht from .htaccess now the redirection is working.
-
well, what was in the file you uploaded?
-
Hi, you probably made a mistake in the .htaccess this will trow a 500 server error.
did you made a backup of the .htaccess
otherwise remove the .htaccess an check if you still get a 500 error?
this is how you add a 301 redirect in .htaccess
Redirect 301 /old/file.html http://www.domainname.com/new.html
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
-
Rel=canonical and redirect on same page
Hi Guys, Am I going slightly mad but why would you want to have a redirect and a canonical redirecting back to the same page. For Instance https://handletrade.co.uk/pull-handles/pull-handles-zcs-range/d'-pull-handle-19mm-dia.-19-x-150mm-ss/?tag=Dia.&page=2 and in the source code:- <link href="<a class="attribute-value">https://handletrade.co.uk/d'-pull-handle-19mm-dia.-19-x-150mm-ss/</a>" rel="<a class="attribute-value">canonical</a>" /> Perfect! exactly what it is intended to do. But then this page is 301 redirected tohttps://handletrade.co.uk/pull-handles/pull-handles-zcs-range/d'-pull-handle-19mm-dia.-19-x-150mm-ss/ The site is built in open cart and I think it's the SEO plugin that needs tweaking. Could this cause poor SERP visibility? This is happening across the whole site. Surely the canonical should just point to the proper page and then there is no need for an additional bounce.
Technical SEO | | nezona1 -
Is there a limit to Internal Redirect?
I know Google says there is no limit to it but I have seen on many websites that too many 301 redirects can be a problem and might negatively affect your rankings in SERPs. I wanted to know especially from people who worked on large ecommerce site. How do they manage internal redirect from one URL to other and how many according to you are too many. I mean if you get a website that contain 300 plus 301 redirections within the website, how will you deal with that? Please let me know if the question is not clear.
Technical SEO | | MoosaHemani0 -
Redirecting pages from a website to another
Hello Moz community, I’ve got a question and hope you can help! I’ve been working to improve my website’s ranking for the keywords “singing lessons London”. My current website url is http://www.sonic-crew-london.com and the page dedicated to the singing lessons is http://www.sonic-crew-london.com/booking/singinglessons.php I’ve recently bought the url http://www.singing-lessons-london.com which I hope will help to climb Google’s ranks a bit more easily for my chosen keywords. I thought I could redirect the old singing page to the new url. Is that something you would recommend me to do? Is there any specific procedure I should follow to make sure the transition runs smoothly? Any help really appreciated! Many thanks
Technical SEO | | SonicCrewLondon0 -
Existing content & 301 redirects
Hi All, I will try to keep this to the point. One of our websites was hit by penguin for unnatural linking. We are building a new site (same business, different domain), but we would like to take some of the pages/content off the old website and use it on our new site. Is it just a case of copying each page onto our new site and 301 redirect the old URL? Or should I just be completely rewording/recreating the old content so it is unique? Any help on this would be great, but I am also open to alternate methods too. Thanks Lewis
Technical SEO | | SO_UK0 -
Slug redirect
Hi All, I'm facing a small yet big problem on one of my sites that I'll try to explain: I have a site with thousands of URL's, all with an odd link structure, like index.php/modules?=name=Video , etc I want to build a proper link structure and for that I'll have to replace that links. My question is: 1. Will I have any relevant SEO problem to do 301 redirects from the old links to the new?
Technical SEO | | nunob.staredition
2. Should I do it all at the same time or do it by parts?
3. What options do I have to avoid give not found errors / redirects for the old links? Thanks for the help.0 -
Htaccess code to 301 redirect a folder change
Hi, I need some help to redirect all my site as there was a folder change. eg, the old structure was www.mysite.com/stuff-1/bags.html and I need it to go to the same structure without the "-1" eg: /stuff/bags.html
Technical SEO | | Paul_MC
The "bags.html" will be lots of different products, so this would be a wildcard? What would the htaccess code need to be? Thanks0 -
301 Redirecting weird URLs with % in them
I've been working on redirecting links reported as 404 in Google webmaster tools. I've stumbled upon 41 URLs that Google is reporting as 404 that include a '%' in the URL, but I don't know how to redirect. Here is an example: URL: bond_information.htm%20Surety%20Bond%20Information,%20with%20FAQ Attempted redirect: redirect 301 /bond_information.htm%20Surety%20Bond%20Information,%20with%20FAQ http://www.mysite.com/ Unfortunately, after implementing the redirect, http://www.mysite.com/bond_information.htm%20Surety%20Bond%20Information,%20with%20FAQ still resolves a 404 error. Anyone successfully fix these errors using Apache .htaccess?
Technical SEO | | TheDude0 -
Redirect
How do I redirect this url: http://www.example.com/img/head/beauty-spa.jpg" width="114" height="50" alt="image"/></a> </div> <div class="c0 r"><a href="/m/imgres?q=short+holiday+treatments Thank you for your help.
Technical SEO | | petrakraft0