http-status-code-301

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

穿精又带淫゛_ 提交于 2019-11-26 21:30:31
问题 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 the lines of: error_page 302 = @target; But I doubt 301/302 redirects can be handled the same as 404's etc etc... I mean, error_page probably doesnt apply to 200, etc error codes? So to summarize: Our backends send back 301/302s once in a while. We would like to have nginx intercept these, and

301 redirect from URL with query string to new domain with different query string

夙愿已清 提交于 2019-11-26 17:48:16
问题 I am trying to figure out how to do a 301 redirect in my htaccess file to redirect some files to a new domain. Here's what I need to know how to do: OLD URL: http://www.example.com/index.php?page=news&id=2366 NEW URL: http://www.example2.com/news.php?name=23546 The redirects don't have to be automatically created. I can hard-code the pages I need to redirect in the htaccess file, I just don't know the format to use as I've read that a "standard" 301 redirect won't work with query strings.

.htaccess redirect without changing address bar

放肆的年华 提交于 2019-11-26 17:45:18
问题 I'm trying to write an .htaccess rule to redirect to a script, which further redirects somewhere else. Kind of like how URL shorteners work. However, I don't want the address bar to change during the .htaccess part of the redirect. (It's okay for the script redirect to change the location.) I'm using mod_rewrite , currently doing this: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteBase / RewriteRule (.+)$ "?url=$1" [L,R=301] Is there a flag or another method I can use to achieve

301 redirect .htaccess

你。 提交于 2019-11-26 17:16:00
问题 How do I 301 redirect, for example: a subdirectory /Blog/ to /blog/ with .htaccess? 回答1: Redirect 301 /Blog /blog Or use something like http://www.htaccessredirect.net/index.php 回答2: The way that immediately comes to mind: RewriteEngine on RewriteBase /path/to/your/web/app RewriteRule ^Blog$ blog [R=301,L] RewriteRule ^Blog/(.*)$ blog/$1 [R=301,L] There are probably much better ways than mod_rewrite, and I'm not 100% sure that the external redirects will work as they should -- you may need

Apache 301 Redirect and preserving post data

ぐ巨炮叔叔 提交于 2019-11-26 14:40:30
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. Unable to find a solution so far, have tried excluding post method from rewrites - worst case scenario we could use the old type URLs for post methods. Is there something that can be done? Thanks POST data is discarded on redirect as a client will perform a GET request to the URL specified by the 301. Period. The only option is to convert the POST parameters to GET parameters and tack them onto the

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

心已入冬 提交于 2019-11-26 11:58:44
Is the client supposed to behave differently? How? Status 301 means that the resource (page) is moved permanently to a new location. The client/browser should not attempt to request the original location but use the new location from now on. Status 302 means that the resource is temporarily located somewhere else, and the client/browser should continue requesting the original url. Rohit When a search engine spider finds 301 status code in the response header of a webpage, it understands that this webpage no longer exists, it searches for location header in response pick the new URL and replace

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

怎甘沉沦 提交于 2019-11-26 07:57:27
问题 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 future requests should be repeated using another URI. They seem to be similar. 回答1: An overview of 301 , 302 and 307 The RFC 7231, the current reference for semantics and content of the HTTP/1.1 protocol, defines the 301 (Moved Permanently) and 302 (Found) status code, that allows the request

Apache 301 Redirect and preserving post data

岁酱吖の 提交于 2019-11-26 03:58:31
问题 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. Unable to find a solution so far, have tried excluding post method from rewrites - worst case scenario we could use the old type URLs for post methods. Is there something that can be done? Thanks 回答1: POST data is discarded on redirect as a client will perform a GET request to the URL specified