http-status-code-301

How to do a non-cached 301 redirect?

送分小仙女□ 提交于 2019-11-30 13:02:20
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? Core Xii 301 is a permanent redirect, so caching makes sense. If your redirect isn't permanent, use 307 (temporary redirect), 302 (found) or 303 (see other). See here for the appropriate use cases. To elaborate on the differences between these three: 307 is the generic, temporary redirect for when a resource is moved. For example, a URL like domain.com/news/latest might do a 307 redirect to the latest news article, domain.com/news/article

How long does Chrome remember a 301 redirect?

ε祈祈猫儿з 提交于 2019-11-30 10:54:59
问题 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. I also have a new domain for the interim at least. Is there (are there) particular durations of times when Chrome in particular will store 301 cached redirects? Some other questions, How long do browsers cache HTTP 301s? and How is 301 redirect implemented by different browsers? , ask, and the

Mass 301 redirects in ASP.NET, including pages that need to redirect to a different place depending on the query string parameters

人盡茶涼 提交于 2019-11-30 10:51:37
We have several pages of our site indexed using old non-SEO friendly URLS such as http://www.domain.com/DocumentDetails.aspx?id=555 . Recently we implemented routing that uses slugs stored in the database and looks up the slug to forward you to the right page using routing, for example: http://www.domain.com/Documents/Title-of-the-Document This is all well and good however we are having a hard time finding the best way to set up our 301 permanent redirects for all the links currently indexed by Google. Is there a way to have 1 centralized place to store old URL and new URL, and have it do the

Remove query strings from 301 redirect

非 Y 不嫁゛ 提交于 2019-11-30 09:07:40
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 subfolder (named 'about') to a new page on the new domain. The new domain's URL looks like this: http://www.newsite.com/info So, I set up a redirect that looks like this: redirectMatch 301 ^/about/ http://www.newsite.com/info It is redirecting just fine, but it's keeping the original URL string attached, so the new URL ends up looking like this in a

PHP Page redirect problem - Cannot modify header information [duplicate]

巧了我就是萌 提交于 2019-11-30 08:36:30
This question already has an answer here: How to fix “Headers already sent” error in PHP 11 answers Reference - What does this error mean in PHP? 34 answers I have a page that displays various elements even if the id it's calling from the database does not exist or was deleted (which throws up all sorts of ugly errors along with search engines continuing to list non-existent pages). Can you modify the first part of the page code shown below to send a 404 (or at least to projecterror.php which has 404 headers) if $id does not exist? Many thanks! <?php include_once("includes/linkmysql.php");

Global 301 redirection from domain to www.domain

无人久伴 提交于 2019-11-30 07:14:59
问题 could i use the begin request of Global.asax to redirect everything, from mydomain.domain to www.mydomain.domain ? If this one is true, how can i do that? 回答1: protected void Application_PreRequestHandlerExecute(Object sender, EventArgs e) { string currentUrl = HttpContext.Current.Request.Path.ToLower(); if(currentUrl.StartsWith("http://mydomain")) { Response.Status = "301 Moved Permanently"; Response.AddHeader("Location", currentUrl.Replace("http://mydomain", "http://www.mydomain"));

Asp.Net MVC 301 Redirects

断了今生、忘了曾经 提交于 2019-11-30 07:13:43
问题 We used to use ISAPI Re-Write (Infact its still on our server) although it doesnt work with ASP.Net MVC (Somthing to do with 'euxd' get param). We need a relaiable way to implement simple 301 redirects, when we change the site structure, upload a new site etc. Any suggestions? Ok, it I wanted to redirect /SomeFolder/SomePage.HTML?Param1=X to /NewPage/X How can we do that? 回答1: If you are using IIS7, I would recommend using the official IIS7 URL Rewrite module. Using the URL Rewrite Module

Redirecting default.aspx to root virtual directory

三世轮回 提交于 2019-11-30 06:56:55
问题 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 to do this redirect through code only, not by any IIS settings. I am unable to do so via code mentioned in this article: http://www.4guysfromrolla.com/articles/072810-1.aspx The code: if (request.RawUrl.Equals("/default.aspx")) { newUrl = string

301 Redirect one domain to another using web.config

喜夏-厌秋 提交于 2019-11-30 06:27:05
I have multiple domains pointing to one hosting location. I wish to establish one of the domains as my main domain and therefore I wish to perform a 301 redirect to this main domain whenever a user accesses my site from a secondary domain. For example: www.example.com This is my main domain. I want all other domains associated with my site to redirect to here. If a user comes in on: www.test.com or www.test.com/anypage etc. Then I want the user to be redirected to the example version of that page. How do I do this using the web.Config file of my application? The reason I ask is that usually my

PHP 301 Redirect, Impossible?

☆樱花仙子☆ 提交于 2019-11-30 04:56:38
I have been trying to do a proper 301 redirect and have failed to do so. No matter what i try, its always a 302 redirect. Returns a 302: http_redirect("urlgoeshere", '', false, HTTP_REDIRECT_PERM) Returns a 302: header("HTTP/1.1 301 Moved Permanently"); header("Location: urlgoeshere"); Can anyone explain why these are coming back as 302's and not 301's? Server OS is linux, running PHP/5.2.14. Try it yourself. I will give you guys a URL to try. I am testing using YSlow and Googlebot. Should be 301: http://www.fantasysp.com/player/mlb/Albert_Pujols/1486349 Pretty straightforward actually: header