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
15
votes
4 answers
How to use a non-www domain with heroku?
I know they don't support it, but seriously, how to do it? Point A-records to an ip which only serves up a 301 to heroku? That sounds really dumb. Am I missing something?
Is there a simpler workaround?

dsp_099
- 5,801
- 17
- 72
- 128
15
votes
5 answers
How to 301 redirect in ASP.NET 4.0?
I am trying to implement URL redirect for the website rather than doing it page by page. I want to do it in the global.asax file. Below is the code i have defined.
I want to have http://website.net as my main url & want to have a permanent URL…

Learning
- 19,469
- 39
- 180
- 373
14
votes
2 answers
Silex: Redirect with Flash Data
I need to redirect one page to another with a message in Silex. Hopefully there's a Laravelesque way of doing it, but I highly doubt it:
$app->redirect('/here', 301)->with('message', 'text');
I'd then want to display the message in my template:
{{…

Mike Rockétt
- 8,947
- 4
- 45
- 81
13
votes
1 answer
react-router how do I use redirectLocation or the 301 or 302 status
We are about to deploy our site in reactjs and we have (re)moved one url but merged it in our main page so from /[product]/menu we merged it to /[product]. Now they said I should respond with 301 for /[product]/menu and redirect it to /[product],…

index
- 3,697
- 7
- 36
- 55
13
votes
6 answers
Redirecting default.aspx to root virtual directory
I have a simple ASP.NET 3.5 application running under IIS7 under a virtual directory. So the URL of my app is like http://example.com/app. I want to 301-redirect the request to example.com/app/default.aspx to example.com/app for better SEO. I have…

AsifQadri
- 2,388
- 1
- 20
- 30
13
votes
2 answers
htaccess multi language site with sub directories, and default 301
I am having some issues setting up my htaccess to allow multiple languages utilising the sub directory method eg:
http://www.domain.com/en/
http://www.domain.com/sw/
http://www.domain.com/ie/
Also to complicate things, the project isn't currently…

Horse
- 3,023
- 5
- 38
- 65
13
votes
3 answers
Redirect all request from old domain to new domain
I am looking to migrate from old domain to new domain.
I have my old domain olddomain.com and new domain newdomain.com pointing to same ip address for now.
I have Apache server inplace to handle requests.
How do I 301 redirect all my…

Amol Ghotankar
- 2,008
- 5
- 28
- 42
13
votes
2 answers
How to do a non-cached 301 redirect?
A while ago all browsers changed their behaviour and started caching 301 redirects, I would like to know how to do a 301 redirect that is not cached in php?

Timo Huovinen
- 53,325
- 33
- 152
- 143
12
votes
1 answer
Using regular expression in htaccess for 301 redirects
I have a Wordpress blog where I am redirecting blog posts from my old blog to my new blog in the format below:
The old blog is called 'News' and the new blog is simply called 'Blog' - both exist on the same domain in a subdirectory as indicated…

Zabs
- 13,852
- 45
- 173
- 297
12
votes
2 answers
Remove query strings from 301 redirect
I am struggling to create appropriate 301 redirects for a site that was originally built using query strings. The old URL structure looks like this:
http://www.oldsite.com/about/index.cfm?fuseaction=cor_av&artID=5049
I want to redirect the entire…

Ash
- 345
- 1
- 5
- 16
11
votes
3 answers
StackOverflow like URL Routing
Its my understanding that the questions in StackOverflow has the following format
http://stackoverflow.com/questions/{question-id}/{slug-made-from-question-title}
So basically the question is retrieved using the question-id. so whatever value I…

naveen
- 53,448
- 46
- 161
- 251
11
votes
7 answers
Laravel 5.2 How To redirect All 404 Errors to Homepage
How can I redirect all 404 errors to homepage? I have custom Error Page but google analytics is throwing too much errors.

Buglinjo
- 2,067
- 1
- 15
- 26
11
votes
1 answer
Why does Django's HTTPResponseRedirect use the same HTTP method for PUT but not POST?
I have a Django project where I'm using a view to handle different HTTP methods. The POST handled the creation of an object and then redirected to the same view as a GET (or so I thought), using Django's redirect() shortcut (HTTPResponseRedirect) to…

hanleyhansen
- 6,304
- 8
- 37
- 73
11
votes
2 answers
301 curl does not show without -v
I was looking at the 301s that several 2.level domains use to redirect to their www 3.level domain, and I thought curl on its own was enough, for example
curl myvote.io

fidetrainerNET
- 101
- 1
- 1
- 7
11
votes
1 answer
Setting status code in Sinatra's custom error block
I have a custom error message for 400 status code:
get '/do' do
raise ParamXMissingError unless params['x']
end
error ParamXMissingError do
haml :custom_error_page
end
I want ParamXMissingError to be 400, but when I run the above code, and…

garbagecollector
- 3,731
- 5
- 32
- 44