Skip to main content

Questions tagged [http-status-code-301]

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.

http-status-code-301
1582 votes
34 answers
3.9m views

How do I make a redirect in PHP?

Is it possible to redirect a user to a different page through the use of PHP? Say the user goes to www.example.com/page.php and I want to redirect them to www.example.com/index.php, how would I do so ...
Sam's user avatar
  • 18.9k
562 votes
25 answers
678k views

Generic htaccess redirect www to non-www

I would like to redirect www.example.com to example.com. The following htaccess code makes this happen: RewriteCond %{HTTP_HOST} ^www\.example\.com [NC] RewriteRule ^(.*)$ http://example.com/$1 [L,R=...
deepwell's user avatar
  • 20.8k
528 votes
19 answers
315k views

How long do browsers cache HTTP 301s?

I am debugging a problem with a HTTP 301 Permanent Redirect. After a quick test, it seems that Safari clears its cache of 301s when it is restarted, but Firefox does not. When do IE, Chrome, Firefox ...
Liam's user avatar
  • 20.5k
456 votes
8 answers
214k views

HTTP redirect: 301 (permanent) vs. 302 (temporary)

Is the client supposed to behave differently? How?
flybywire's user avatar
  • 269k
278 votes
3 answers
104k views

What's the difference between HTTP 301 and 308 status codes?

What's the difference between HTTP 301 and 308 status codes? 301 (Moved Permanently): This and all future requests should be directed to the given URI. 308 (Permanent Redirect): The request and all ...
Alexander Drobyshevsky's user avatar
79 votes
8 answers
19k views

What is the best approach for redirection of old pages in Jekyll and GitHub Pages?

I have blog on github pages - jekyll What is the best way to solve url strategy migration? I found the best practice in common is create htaccess like so Redirect 301 /programovani/2010/04/git-co-...
Mailo Světel's user avatar
71 votes
5 answers
161k views

PHP header redirect 301 - what are the implications?

I have example.com. If the user is logged in, it should load automatically example.com/option-X where X is a predefined choice of the user. So, I do this at the top of index.php: header("Location:...
Andres SK's user avatar
  • 10.9k
68 votes
6 answers
38k views

How long does Chrome remember a 301 redirect?

I have a new author site that I want to make available from a domain that I had previously used Apache rewriting to bounce traffic to my Amazon site, [R=301,L], which I want to serve up as my own site....
Christos Hayward's user avatar
59 votes
7 answers
121k views

.htaccess 301 redirect of single page

After a site redesign, I've got a couple of pages that need to be redirected. Everything is staying on the same domain, just a couple of things have been reorganised and/or renamed. They are of the ...
Dan's user avatar
  • 926
39 votes
4 answers
54k views

Apache 301 Redirect and preserving post data

I have implemented SEO URLs using Apache 301 redirects to a 'redirect.cfm' in the root of the website which handles all URL building and content delivering. Post data is lost during a 301 redirect. ...
Daniel Cook's user avatar
  • 1,043
39 votes
5 answers
45k views

Are 301 redirects possible using javascript or jQuery?

I'm running Apache 2.0 and I'm just wondering if it is possible to make a 301 redirect using JavaScript or jQuery. I have an <a></a> tag with href to a specified location and I'm asked to ...
Caleb Doucet's user avatar
  • 1,771
35 votes
2 answers
124k views

Redirecting 404 error with .htaccess via 301 for SEO etc

I couldn't find a straight answer to my question and need to know it from the real experts. I had a website which urls were generated by Joomla. I believe that tons of urls are around in the search ...
Chris's user avatar
  • 1,919
33 votes
6 answers
18k views

Nginx Remove WWW And Respond To Both

I have the following nginx configuration fragment: server { listen 80; server_name mydomain.io; root /srv/www/domains/mydomain.io; index index.html index.php; access_log /var/log/...
Justin's user avatar
  • 44.6k
31 votes
3 answers
25k views

Does 301 redirect always preserve referrer?

I want to know whether 301 redirect always preserve referrer. I make a page called "gotoorig_https.html" which contains a hyperlink to a page "orig_https.asp". "orig_https.asp" will 301 redirect to "...
Billy's user avatar
  • 15.7k
28 votes
4 answers
59k views

Intercepting backend 301/302 redirects (proxy_pass) and rewriting to another location block possible?

We have a couple of backends sitting behind our nginx front ends. Is it possible to intercept 301 / 302 redirects sent by these backends and have nginx handle them? We were thinging something alone ...
anonymous-one's user avatar

15 30 50 per page
1
2 3 4 5
121