http-status-code-301

IIS7 or .Net 301 Redirects from 1 domain to another

柔情痞子 提交于 2019-12-10 10:48:09
问题 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

301 redirect / all images to CDN

我与影子孤独终老i 提交于 2019-12-10 10:15:17
问题 For a image gallery I have to use a CDN. Therefor I create a subdomain image.example.com This subdomain points via CNAME to the CDN URL. Old image path: http://www.example.com/files/thumbs I changed all image path in the gallery to: http://images.example.com/files/thumbs I need a 301 redirect from http://www.example.com/files/thumbs to http://images.example.com/files/thumbs I made already a post about this. Redirect folder to subdomain with folder In coordination with anubhava I open now a

Redirect all request from old domain to new domain

≯℡__Kan透↙ 提交于 2019-12-09 02:49:14
问题 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 olddomain.com/* & www.olddomain.com/* to newdomain.com/* Can I get exact regex or configuration that I need to add in htaccess . My newdomain.com and olddomain.com both are being serverd by same apache from same IP so "/" redirect might lead to cycles? And so was

Will PHPs fopen follow 301 redirects?

旧时模样 提交于 2019-12-08 19:18:00
问题 We have a piece of legacy code that (ab)uses fopen() calls to resources over HTTP: @fopen('http://example.com') We want to move example.com to another host and then send "301 Permanently Moved", however, we are not entirely sure if @fopen() will follow this. Initial tests show me that it does not. But maybe I miss some configuration piece. 回答1: Since version 5.1.0, there's the max_redirects option, which makes the fopen HTTP wrapper follow the Location redirect: The max number of redirects to

How do you do a 301 permanant redirect route in ASP.Net MVC

假如想象 提交于 2019-12-08 16:45:53
问题 How do you do a HTTP 301 permanant redirect route in ASP.NET MVC? 回答1: Create a class that inherits from ActionResult... public class PermanentRedirectResult : ActionResult { public string Url { get; set; } public PermanentRedirectResult(string url) { this.Url = url; } public override void ExecuteResult(ControllerContext context) { context.HttpContext.Response.StatusCode = (int)HttpStatusCode.MovedPermanently; context.HttpContext.Response.RedirectLocation = this.Url; context.HttpContext

custom handler not being called when files don't exist .net mvc 3 IIS 7.5

无人久伴 提交于 2019-12-08 12:22:52
问题 I just got a custom handler set up to redirect with a 301 response for some old coldfusion page references that I have on my new mvc 3 site. The problem is, I have to actually have the .cfm files on the server for the handler to take effect. If they're not there, my customerrors element is taking over and doing a 404 redirect...when the files are there, works like a peach. My issue is that I'd have to create a boat-load of empty files for the handler to grab them and I'd like for it to just

trim query string(s) from url

戏子无情 提交于 2019-12-08 11:29:39
问题 Some urls are generated via our script. I need to trim all these via htaccess; I have a few hundred of them, so all ?xxx have to be cleaned. ie: domain.com/page.html?word=gclid=4nwseuoSg to domain.com/page.html or anything starting with ?, the ? and the rest is not needed. I tried RewriteRule ^\?(.*)$ / [R=301,L] but did not work :( What do I have to use instead of \?(.*) ? 回答1: the path doesn't contain the querystring. Use RewriteCond to match any none-empty querystring. RewriteCond %{QUERY

Redirect (301) from domain.com to www.domain.com, while also forcing HTTPS in HTACCESS

ε祈祈猫儿з 提交于 2019-12-08 05:27:28
问题 Ok, so this is what I have originally , which redirects any domain.net or www.domain.net to www.domain.com (with SSL). RewriteEngine On RewriteCond %{SERVER_PORT} !443 RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L] RewriteCond %{HTTP_HOST} ^domain\.net$ [OR] RewriteCond %{HTTP_HOST} ^www\.domain\.net$ RewriteRule ^/?$ "http\:\/\/domain\.com" [R=301,L] Now, I want to force all of these conditions to report 301 to (for search engine purposes): domain.net www.domain.net domain.com

301 Redirect where 2 domains point to same IP?

核能气质少年 提交于 2019-12-08 02:38:00
问题 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}

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

喜欢而已 提交于 2019-12-07 19:49:45
问题 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