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
-
Redirect Chain Issue
I keep running into a redirect chain issue trying to get a non-https/non-www domain to forward directly to the https/www domain on an Apache server. For background, we are forcing https and forcing www, but it appears the non-https/non-www domain is first redirecting to https/non-www and then redirecting again to the desired final https/www version of the domain. (Hope I am making sense here) I am trying to find code to add to my .htaccess file that will perform the following... 301 Redirect
Technical SEO | | FitzSWC
http://example.com directly to https://www.example.com (without 1st redirecting to https://example.com)
http://www.example.com directly to https://www.example.com Any experts in this with any thoughts? Thanks,
Fitz0 -
301 Redirect - Technical Question
I have recently updated a site and for the url's that had changed or were not transferring I set up 301 redirects in the htaccess file as follows This one works - Redirect 301 /industry-sectors http://www.tornadowire.co.uk/fencing But this one doesn't - Redirect 301 /industry-sectors/equine http://www.tornadowire.co.uk/fencing/application/equestrian/ What it does is change the url to this instead http://www.tornadowire.co.uk/fencing/equine ..... which returns a 404 page not found error The server is nginx based server and we have moved from a joomal platform to a wordpress platform I would be grateful for any ideas
Technical SEO | | paulie650 -
60% Internal Redirects
A new client I am working with has a site with over 9,000 internal 301 redirects. These are as a result of old links not being updated and the number of internal 301 redirects far outweighs the number of 'correct' links on the site. My personal opinion is that creates the risk of crawl errors/issues and whilst a 301 redirect is correct in this case, it does not negate the need to update internal links. The problem I have is that when I explain this to the client, they reply with an Matt Cutts video from 2008 that talks about 301 redirects being correct for site migrations. Even though the video is not entirely relevant to the point, I can not get the client to move from his position. Ideally, what I am looking for help with is the following: Am I right in my position that having this many redirects is a potential issue and that internal links should be updated? Does anyone know of any articles from 'notable/reputable' sources that I can use in order to support my position? Thanks in advance for your help.
Technical SEO | | MattHopkins0 -
Where to put 301 redirects in Magento?
I will be changing the URL structure in a magento store from "base/category/subcategory/product" to "base/product" which means i have to make over 1000 URL 301 redirects so our old links still work. Should i put the redirects in a .htaccess file so they stay intact no matter what or should i just put them in with all the other rewrites (in Magento 's URL rewrite manager)? Thanks
Technical SEO | | tilenkrivec0 -
Redirects
If I redirect page A to page B does page A need to exist before Google sees the redirect. Or can I just put up a redirect and delete page A. If the page doesn't need to exist: You have all your redirects in place for a website. You want this website to redirect to another website. You completely delete the website and put up the htaccess, there should be no problem with this, because the redirects are in place correct? Thanks
Technical SEO | | tylerfraser0 -
301 redirect dropped page rank
Hi, We have a www domain that I have changed to a non www domain. The www domain had been in place for some time and had a good page rank, PR4. After this change the page rank dropped significantly (PR0, and now recently back to PR2) despite it being a 301 redirect which I thought "should" carry over the page rank. Yes, I am aware I should have just left it be. Hind sight 20/20 .. ya ya ya 🙂 My questions Is the 301 the correct method for this? Why did the page rank drop despite the 301? Should we go back to the www domain at this point? Thanks Kris
Technical SEO | | adriot0 -
301 redirect
We have just had an outside SEO agency report on our site: One of things brought up were arounf broken links, and how they class them as broken links. Could any body tell me whether this statement holds true please, as I am not aware of this "Our latest intelligence shows that google are downgrading ranking from sites that feature 301 redirects within the internal link structure". Any help would be greatly appreciated Regards
Technical SEO | | Yozzer0