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
-
301 redirect file question
Hi Everyone, I am creating a list of 301 redirects to give to a developer to put into Magento. I used Screaming Frog to crawl the site, but I have noticed that all of their urls 302 to another page. I am wondering if I should 301 the first URL to the url on the new site, or the second. I am thinking the first, but would love some confirmation. Thank you!
Technical SEO | | mrbobland0 -
One more redirect question
If there are two URLs like below: example.com/toys/batman-toys
Technical SEO | | IceIcebaby
example.com/birthday/batman-toys Both have the exact same everything, except URL key. The first example ranks for all KWs and search terms in the SEs. Does having the second page hurt my ranking potential for the first page? Should I redirect the 2nd page to the first or just leave it? As always, thanks for your help.0 -
Using 302 redirect for SEO
Hello, I'm in charge of SEO for an information website on which articles are only accessible if you have a login and password. Most of the natural links we get point to our subscribers' subomain : subscribers.mywebsite.com/article1 If they follow these natural links, visitors who are not logged get redirected (302) to www.mywebsite.com/article1 on which there is an extract of the article and they can request a free test subscription to read the end of the article. My goal is to optimize SEO for the www.mywebsite.com/article1 page. Does this page benefit from the links I get to the subscribers.mywebsite.com/article1 page or are theses links lost in terms of SEO? Thanks for your help, Sylvain
Technical SEO | | Syl200 -
What to do with a 302 redirect after a while
Hi guys, A client of ours has a website with a very bad linkprofile. We adressed this issue and we migrated the website to another domain. We redirected the bad website (cornelisbedding.be) to the new domain (cornelisbedding.com) with a 302 redirect. We didn't want to pass the bad link juice. The problem we are having now is that we can't afford to lose the redirect on cornelisbedding.be. We would lose to much traffic because the old domain still has alot of links that generate good quality traffic. I have read that Google will treat 302 redirects as 301's in the long run. We really want to avoid this.
Technical SEO | | Jacobe
We were thinking of using a meta refresh with a delay on, but in Google's eyes that would be considered spammy. Are their any other suggestions on how to handle this? Thanks you!0 -
260k 301 redirects
Hello, I just found that some of the urls on my site have both ugly characters and some other things I'd like to fix (such as ---- into a single - ) After some local tests i've seen that If i leave some imperfections there will be 48k different urls on the other hand if the renaming procedure is strict i'll have around 260k out of 2.3M urls to be renamed. If I'm going to do this I'll create new canonicals meta tag and redirect old urls with 301 headers to the new location. The content will not change. My big doubt is SEO wise, I know that I'll have better urls, but aren't those too much redirects on a single day? what would you do if you wish to have shipshape urls and know some of these are crap? thanks
Technical SEO | | mylittlepwny0 -
Redirect link from a particular domain
Hi guys/gals, I have a few domains and blogs which I use really for a bit of fun and experimenting. One of the domains (abc.com) wasn't doing much but has a few decent links built to it. I redirected this domain to an active blog (123.com). Here's the problem: There's a particular external link to the homepage of abc.com which drives a lot of traffic but isn't relevant to the content of 123.com which it redirects to, causing a huge bounce rate from this link. Is there a way (maybe using using htaccess) that I can redirect traffic from this one link to another domain completely? I've contacted the owner of the external site but they are unable (or unwilling) to change the link. I hope I haven't lost you all but shout if you need any clarification. Thanks in advance!
Technical SEO | | Confetti_Wedding0 -
301 redirects
At the moment it's possible to access the home page of my website via two different urls, with and without www. and you've told me that this can be resolved with Canonicalization and a 301 redirect. Do I do this with my web hosting package or in my html pages? If I can't do it with my web host (1&1) then is there an idiot's guide of how to do it yourself? I've also got both the domain vamospaella.co.uk and vamospaella.com. Is it better to have one of these redirecting to the other for UK traffic (at the moment .co.uk redirects to .com) Thanks
Technical SEO | | melissa10 -
.htaccess problem using POST method
Hi guys I'm after some help with trying to achieve the following: 1. Canonicalise to http://www. 2. Remove the index.php from root and subfolders. I have the .htaccess code below, which seemed to work fine, but the urls use the POST method and this isn't working with the rewrites. Can anyone please advise as to what I am doing wrong? As you can probably guess .htaccess isn't my strongest SEO discipline! The code I have is: http:// to http://www. RewriteEngine on
Technical SEO | | TrevorJones
RewriteCond %{HTTP_HOST} ^mydomainexample.com
RewriteRule (.*) http://www.mydomainexample.com/$1 [R=301,L] /index.php to / Options +FollowSymLinks
DirectoryIndex index.php RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index.php\ HTTP/
RewriteRule ^index.php$ http://www.mydomainexample.com/ [R=301,L] Subdirectory /index.php to / RewriteCond %{THE_REQUEST} ^[A-Z]+\ /([^/]+/)index.(php|html|htm?)[#?]?
RewriteRule ^(([^/]+/))index.(php|html|htm?)$ http://www.mydomainexample.com/$1 [R=301,L] Just to add to this I have found this which I think is what I need to restrict it to GET: RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,L] Thank you in advance for any suggestions as to how I may put this code together.. Trevor0