http-status-code-301

Can I use a 301 redirect for included external javascript files?

混江龙づ霸主 提交于 2019-12-04 04:57:52
问题 I am trying to clean up some files on a website, one task being to collate all references to jquery to a singular file. Yes, it's a large site with multiple developers and some standards have not been followed resulting in the current situation where there are various versions of jquery referenced. What I have tried to do is create a 301 redirect for these files to point to a single version. eg: <script type="text/javascript" src="/someurl/js/jquery-1.4.4.min.js"> should end up pointing to

Force browsers to forget cached redirects?

試著忘記壹切 提交于 2019-12-04 03:11:24
问题 I inherited a domain that previously had a 301 redirect from the root ("/") to "/index.shtml" I've removed the redirect and a different site on the domain, but people who visited the site in the past will have the redirect behavior cached in their browsers... for a terribly long time, unless they manually clear their caches. Anyone trying to go to example.com in these browsers will be sent to example.com/index.shtml before they even make any HTTP requests. Right now this is a huge problem

Cannot remove 301 redirect

笑着哭i 提交于 2019-12-04 00:53:24
I stupidly did a 301 redirect on websiteA.com to websiteB.com. After removing it from the .htaccess file the redirect is still in operation. I tried from outside the local network and it is still redirecting. I have cleared my cache and tried a different browser. Does anybody have any suggestions? UPDATE: If I add a 302 redirect to this .htaccess file the site honours it. When I remove it, the old 301 redirect still happens. .htaccess file for websiteA.com: # -- concrete5 urls start -- Options -Indexes <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f

Creating Canonical URLs including an id and title slug

我的未来我决定 提交于 2019-12-03 21:43:01
I want to replicate what StackOverflow does with its URLs. For example: Hidden Features of C#? - ( Hidden Features of C#? ) or Hidden Features of C#? - ( Hidden Features of C#? ) Will Take you to the same page but when they return to the browser the first one is always returned. How do you implement the change so the larger URL is returned? The way that I've handled this before is to have two routes, registered in this order routes.MapRoute( null, "questions/{id}/{title}", new { controller = "Questions", action = "Index" }, new { id = @"\d+", title = @"[\w\-]*" }); routes.MapRoute( null,

Canonical links and 301 Redirect if URL doesn't match slug

这一生的挚爱 提交于 2019-12-03 12:45:39
问题 I am trying to implement a URL scheme similar to stack overflow's in django/python. E.g. the pk is stored in the URL along with a slug of the title so for this question (id #4787731) the URL is https://stackoverflow.com/questions/4787731/canonical-links-and-301-redirect-if-url-doesnt-match-slug If I later change the title (or just put in some random crud into the url) then the site will still know which question I am after (by the ID) and will 301 redirect to the correct URL - e.g. try. https

How do I use Scala dispatch to get the URL returned in a 301 redirect?

↘锁芯ラ 提交于 2019-12-03 12:43:25
I am using Scala dispatch HTTP library, version 0.10.1. I make a request to a URL that returns an HTTP 301, permanent redirect. For example, http://wikipedia.com returns a 301 that redirects to http://www.wikipedia.org/ . How do I do I use dispatch to get the redirected URL? Following the tutorial, here's what I've done. import dispatch._, Defaults._ val svc = url("http://wikipedia.com") val r = Http(svc OK as.String) r() This throws a "Unexpected response status: 301" exception. Presumably I need to either query the r value for the redirected URL, or maybe specify some argument other than OK

Client Web Browser Behavior When Handling 301 Redirect

偶尔善良 提交于 2019-12-03 10:05:27
The RFC seems to suggest that the client should permanently cache the response: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html 10.3.2 301 Moved Permanently The requested resource has been assigned a new permanent URI and any future references to this resource SHOULD use one of the returned URIs. Clients with link editing capabilities ought to automatically re-link references to the Request-URI to one or more of the new references returned by the server, where possible. This response is cacheable unless indicated otherwise. The new permanent URI SHOULD be given by the Location field in

PHP header redirect 301 - what are the implications?

限于喜欢 提交于 2019-12-03 06:28:35
问题 I have domain.com . If the user is logged in, it should load automatically domain.com/option-X where X is a predefined choice of the user. So, I do this at the top of index.php: header("Location: /option-X"); But, if the user is not logged in, I just choose automatically the first option like this: header("HTTP/1.1 301 Moved Permanently"); header("Location: /option-a"); So, i have two questions regarding the implications of doing so: Since the search engines crawlers won't be logged in, they

nginx static index redirect

爱⌒轻易说出口 提交于 2019-12-03 03:28:27
This seems ridiculous but I've not found a working answer in over an hour of searching. I have a static website running off nginx (which happens to be behind Varnish). The index file is called index.html . I want to redirect anyone who actually visits the URL mydomain.com/index.html back to mydomain.com . Here is my nginx config for the site: server { listen 8080; server_name www.mydomain.com; port_in_redirect off; location / { root /usr/share/nginx/www.mydomain.com/public; index index.html; } rewrite /index.html http://www.mydomain.com/ permanent; } http://www.mydomain.com/index.html responds

PHP header redirect 301 - what are the implications?

非 Y 不嫁゛ 提交于 2019-12-02 21:38:55
I have domain.com . If the user is logged in, it should load automatically domain.com/option-X where X is a predefined choice of the user. So, I do this at the top of index.php: header("Location: /option-X"); But, if the user is not logged in, I just choose automatically the first option like this: header("HTTP/1.1 301 Moved Permanently"); header("Location: /option-a"); So, i have two questions regarding the implications of doing so: Since the search engines crawlers won't be logged in, they will always get domain.com/option-a - does it affect them that it has a 301 header? What could be the