http-status-code-301

Does PHP's file_get_contents cache a 301 status code?

怎甘沉沦 提交于 2019-12-07 12:27:14
问题 If PHP does cache a permanent redirect: For how long? Can this period be changed? I would also be interested in the default behaviour on this matter of Perl, Python, and any other languages used primarily for web development 回答1: The http_fopen_wrapper.c which is used by file_get_contents() contains no caching logic whatsoever. In particular it responds to the Location: header only, and does not care for the actual HTTP status code. (It does not notice if it's a temporary redirect or a

Pretty URLs Vs. Duplicate Content

流过昼夜 提交于 2019-12-07 11:13:08
问题 I'm trying to clear up a grey area about this much talked about topic... Like most devs, I've made some pretty URLs with mod_rewrite. My sites internal links point to the pretty URLs and things are working nicely. But, I can still access the old URL if I point to it directly. Now, this is most certainly going to cause duplicate content issues so after doing some research it seems that 301 redirects are the way to go. But.... and here's the grey bit... If you are working on a site with

redirecting w., ww., wwww. to -> www

一世执手 提交于 2019-12-06 12:59:42
I'm trying to redirect site.com w.site.com ww.site.com and wwww.site.com to www.site.com. My boss wants to ensure typos make it to the site as well. They redirect fine. I'm using ASP.Net and throw a 301 redirect back using a regular expression, however, tools such as http://www.seoconsultants.com/tools/headers.asp don't seem to show a correct redirect when I try to use w.site.com ww. etc. I'm trying to figure out what google sees, but I'm not sure where to check. It would "appear" that firebug reports it as a 301, but I can't figure out why these tools are reporting back the wrong information.

How do I 301 redirect one domain to the other if the first has a folder path

可紊 提交于 2019-12-06 11:04:33
I want to 301 redirect from: www.olddomain.com to the root of newdomain.com but I want it to work no matter what the folder path is on the old domain. eg: the following should all redirect to the root of newdomain.com www.olddomain.com olddomain.com www.olddomain.com/folder/file.php olddomain.com/folder/file.php How can I do that with Mod Rewrite in the .htaccess file? Try this rule: RewriteEngine on RewriteCond %{HTTP_HOST} (^|\.)old\.example\.com$ RewriteRule ^ http://new.example.com/ [L,R=301] Where old.example.com is the old host name and new.example.com the new. <?php header("HTTP/1.1 301

IIS7 or .Net 301 Redirects from 1 domain to another

久未见 提交于 2019-12-06 10:04:08
I have 2 domains. For the question, I will call them www.old.com and www.new.com. Both urls are pointing to the same IIS7 Site instance. I need to it up so that when someone goes to www.old.com they get a 301 redirect to www.new.com. The tricky part is I am using URL rewrites for pages within the site. So www.old.com/About.aspx redirects to www.new.com/About. To get that to work with IIS7 URL rewrite rules, it also means that www.new.com/About.aspx redirects to www.new.com/About. That is fine and is not a big deal. My issue is how do I redirect the main domain without losing the URL Rewrites

301 Redirect where 2 domains point to same IP?

老子叫甜甜 提交于 2019-12-06 09:34:47
I have 2 TLDs example.com and example.ie . example.com and example.ie both point at the same IP address and pull the same content now we could get whacked with a ban hammer from Google for duplicate content so we want anyone accessing *.example.ie and *.example.com to be redirected to www.example.com the problem is as they are both pointing at the same server the .htaccess is the same thus I don't believe we can do the usual: Options +FollowSymlinks RewriteEngine on rewritecond %{http_host} ^example.com [nc] rewriterule ^(.*)$ http://www.example.com/$1 [r=301,nc] So how do we go about creating

How to redirect everything via Web.config or C# to https://www. version of the site?

大憨熊 提交于 2019-12-06 07:21:54
问题 I have an ASP.NET website hosted on GoDaddy. I need to redirect (301) every request to https://www.example.com/whatever So for example: http://example.com will be redirected to https://www.example.com http://www.example.com will be redirected to https://www.example.com http://example.com/section/page will be redirected to https://www.example.com/section/page This is a piece of cake on Linux or cPanel hostings. But I don't know how to do this on GoDaddy (I asked support, but they don't seem to

Sharepoint 2010 search cannot crawl mediawiki site

余生颓废 提交于 2019-12-06 05:54:22
问题 Using Sharepoint 2010 enterprise search, we are trying to crawl our internal mediawiki based wiki site. Search fails with error : 'The URL was permanently moved. ( URL redirected to ... )'. Since the wiki site has case sensitive URLs, when Sharepoint 2010 tries to crawl with lower case URL names, the Wiki says 'page does not exists' and redirects with 301 !!! Any got a solution ? Thanks in advance. 回答1: By default, all links crawled are converted to lower case by the SharePoint search indexer

Does PHP's file_get_contents cache a 301 status code?

元气小坏坏 提交于 2019-12-05 20:25:40
If PHP does cache a permanent redirect: For how long? Can this period be changed? I would also be interested in the default behaviour on this matter of Perl, Python, and any other languages used primarily for web development The http_fopen_wrapper.c which is used by file_get_contents() contains no caching logic whatsoever. In particular it responds to the Location: header only, and does not care for the actual HTTP status code. (It does not notice if it's a temporary redirect or a permanent.) If you want more direct control over your http queries I suggest using curl . 来源: https:/

Pretty URLs Vs. Duplicate Content

天大地大妈咪最大 提交于 2019-12-05 17:37:00
I'm trying to clear up a grey area about this much talked about topic... Like most devs, I've made some pretty URLs with mod_rewrite. My sites internal links point to the pretty URLs and things are working nicely. But, I can still access the old URL if I point to it directly. Now, this is most certainly going to cause duplicate content issues so after doing some research it seems that 301 redirects are the way to go. But.... and here's the grey bit... If you are working on a site with thousands of URLs, what's best practice to achieve this? I don't wantto list 1k+ lines in .htaccess I thought