The 301 or Moved Permanently error message is a HTTP standard response code indicating that the requested resource has been assigned a new permanent URI. Future references should use one of the returned URIs.
Questions tagged [http-status-code-301]
1797 questions
4
votes
1 answer
nginx Clear 301 Permanent from clients browser cache
I foolishly used 301 instead of 302 for a particular redirect in Nginx
location /somewhere/ {
return 301 /somewhere/neat/;
}
but now I need to change where we redirect too:
location /somewhere/ {
# 302 now, lets not make the same mistake…

PandemoniumSyndicate
- 2,855
- 6
- 29
- 49
4
votes
1 answer
.htaccess redirect all pages except the home page
I have just merged two websites. Site A is now merged with site B.
Site A has got a .htaccess file which redirects all of the content to the new domain where site B is hosted.
RewriteRule (.*) http://www.siteb.com/$1 [R=301,L]
It is working…

richelliot
- 588
- 2
- 10
- 30
4
votes
3 answers
Why redirects happens on missing of a trailing slash (/) from the URL ?
One of the most wasteful redirects happens when a trailing slash (/) is missing from a URL that should otherwise have one.For example, going to http://example.com/action results in a 301 response containing a redirect to http://example.com/action/…

choudhury smrutiranjan parida
- 2,588
- 5
- 28
- 39
4
votes
1 answer
.htaccess template
I made an .htaccess template; is there anything else that should be added or changed?
# DEFAULTS
ServerSignature Off
AddDefaultCharset UTF-8
DefaultLanguage en-US
SetEnv Europe/Belgrade
SetEnv SERVER_ADMIN chrisp@dejan.com.au
#…

dzhi
- 1,534
- 2
- 18
- 29
4
votes
1 answer
Can you detect a 301 redirect with Microsoft.XMLHTTP object?
I'm using VBScript and the Microsoft.XMLHTTP object to scrape some web data. I have a list of URLs to check, but unfortunately some of them 301 redirect to others on the list, so I wind up with redundant data.
Is it at all possible to make the…

dmb
- 603
- 4
- 11
4
votes
1 answer
Apache Mod_Rewrite Htaccess for Dynamic URL
I have this link
www.example.com/1/title
which goes to
www.example.com/post.php?author=1&title=title
because of this rule
RewriteRule ^post/([0-9]+)/([\w-_:]+)/?$ post.php?author=$1&title=$2 [L,QSA,NC]
Fine, but now how do make it such that if…

Noodle Head
- 431
- 3
- 10
- 23
4
votes
2 answers
Detect HTTP 301 status code from JavaScript
I need to detect client side if a requested file (with XMLHttpRequest) had a 301 response. The reason of doing this is because I need to request other files related to the file where user has been redirected and not related to the first one…

Manuel Bitto
- 5,073
- 6
- 39
- 47
4
votes
1 answer
Differentiate between failed(no network) and cancelled request in ajax error(HTTP status code 0)
I am using Jquery ajaxError to catch all ajax errors. I am having problem with http status code 0. This code is returned when the request fails(no network), or if user refreshes page(or clicks on other tab). I want to differentiate between both. Is…

Ankur
- 12,676
- 7
- 37
- 67
4
votes
2 answers
Htaccess redirect all files from subdirectory in one domain to another domain
I am trying to create a permanent htaccess redirect (301) from all files in one directory in one domain, to another domain as follows:
Redirect all files in the following directory:
http://www.primary.com/apples/*
To:
http://www.secondary.com
I am…

AnchovyLegend
- 12,139
- 38
- 147
- 231
4
votes
8 answers
Is a "404 redirect" a legitimate redirect?
I have a situation where some users may come to mistyped pages, from links, etc. In most situations I can determine the correct page that should be displayed, so I want to redirect to the correct URL.
Is a 301 Redirect appropriate in this case. 301…

DisgruntledGoat
- 70,219
- 68
- 205
- 290
4
votes
1 answer
htaccess redirect for subdomains -> similarly-named subdirectories?
I'm restructuring a web site with a great deal of content currently parked at URLs that look like this.
http://string.domain.com/year/month/dd/string-pulled-from-title
For various reasons, I'd like to park all new content at URLs that looks like…

bflora2
- 733
- 3
- 8
- 26
4
votes
0 answers
Apache Content Negotiation, File Extensions, and Permanent Redirects
Given an Apache 2.x web server that uses Content Negotiation (+MultiViews) to access URLs without their extensions (e.g., allow /foo vs. /foo.php or /foo.html), how does one issue a 301 permanent redirect when someone does in fact try to use those…

Joe D'Andrea
- 5,141
- 6
- 49
- 67
4
votes
1 answer
HTTP 307 Redirects -- Supported By Most Browsers Since IE6?
So evidently in 2010, Matt Cutts at Google revealed in an interview, along with a follow-up email exchange after the interview, that Google deducts page rank if you use domain-to-domain HTTP status 301 redirects. In other words, if you have…

Volomike
- 23,743
- 21
- 113
- 209
4
votes
1 answer
JSF 2 -- Permanent Redirect (301)
I'm trying to implement a 301 redirect from within JSF but when I firebug it I always see a 302 being executed. Would someone be able to show me how to alter the method below to accomplish a 301?
/**
* Redirect to specified destination url
*
*…

Dave Maple
- 8,102
- 4
- 45
- 64
4
votes
3 answers
Redirect 301 www.www.example.com
I'm using LAMP server, and I need to redirect requests like:
www.www.example.com to www.example.com and other variations like (wwww.example.com, etc)
I know I can do it in .htaccess, but I don't know the regular expression that I should use to…

Pedro
- 2,907
- 6
- 34
- 46