http-status-code-301

Are 301 redirects possible using javascript or jQuery?

微笑、不失礼 提交于 2019-12-17 11:27:28
问题 I'm running Apache 2.0 and I'm just wondering if it is possible to make a 301 redirect using JavaScript or jQuery. I have an <a></a> tag with href to a specified location and I'm asked to make a 301 redirect when I click that link. This is for SEO and I'm trying to find a way to do the 301 redirect to the same page in the link without having to create a new page or create a form/submit. 回答1: In short No . JavaScript runs entirely on the client side. 301 redirects are supposed to come as a

How long do browsers cache HTTP 301s?

你离开我真会死。 提交于 2019-12-16 20:02:10
问题 I am debugging a problem with a HTTP 301 Permanent Redirect. After a quick test, it seems that Safari clears its cache of 301s when it is restarted, but Firefox does not. When do IE, Chrome, Firefox and Safari clear their cache of 301s? UPDATE: For example, if I want to redirect example1.com to example2.com , but I accidentally set it to redirect to example3.com , that is a problem. I can correct the mistake, but anyone who has visited example1.com in the meantime will have cached the

NodeJS/Express automatic detection of SSL over HTTP (HTTPS) explanation?

孤街浪徒 提交于 2019-12-13 20:15:18
问题 I have a server over HTTPS on NodeJS with Express. When uploading a file, I have used the req.protocol directive in the controller to get either the HTTP or HTTPS "part" of the URL, so that I can save the file with the absolute URL. The problem is that without enabling the "trust proxy" setting of express (http://expressjs.com/en/api.html#trust.proxy.options.table), HTTPS doesn't get detected. I thought this setting was used in the case of the actual redirect (when using the HTTP URL and the

301 Redirect with custom message

浪尽此生 提交于 2019-12-13 08:52:34
问题 Is there anyway to do 301 Redirect with custom message using .htaccess? Eg. Before the redirect begins, it will say: "We have moved permanently to abc.com and this domain will be expired soon. So please update your bookmark accordingly. You will be redirected in 10 seconds." Or that's only possible with PHP or other programming languages? 回答1: No -- because 301 code has to be issued on the server side. Browser/Search bot checks the response code and if code is 301 it will ignore any content

301 Redirect dynamic urls from database in asp.net

☆樱花仙子☆ 提交于 2019-12-13 05:44:36
问题 I have thousands of links which need to be redirect to new URL using 301 Permanent Redirect . I have all these urls in the Database table. I would like to know where should be these URLs should be loaded (only once). And can be used for 301 permanent redirect. Sample URLs: *RequestForURL* *301Redirect* why-me/onboard-experience/food-and-drink-for-all-tastes/family-casual/-> /why-me/family-test/ why-me/onboard-experience/food-and-drink-for-all-tastes/room-service/-> /why-me/onboard-experience

How best to redirect a webpage without using Javascript?

独自空忆成欢 提交于 2019-12-13 03:17:59
问题 I have some script in my default page that redirects users to language specific versions of my website depending on the language of the browser. I want to add something that redirects those users who do NOT have Javascript enabled. Currently I have the following : <noscript> <META HTTP-EQUIV=REFRESH CONTENT="1; URL=en/index.htm">. </noscript> But I've read this is not too wise as some search engines frown upon it. How do I do this and keep search engines happy? 回答1: You can redirect at server

Redirect php page to another php page using 301 .htaccess

白昼怎懂夜的黑 提交于 2019-12-13 00:42:00
问题 I have a dynamic page that I need to redirect to another dynamic page in .htaccess. I have tried different syntax for the redirect but nothing seems to work: RewriteEngine on RewriteRule /index.php?p=page&page_id=store$ http://www.website.com/index.php [R=301] OR RewriteEngine on RewriteCond %{QUERY_STRING} ^p=page&page_id=store$ RewriteRule ^/index.php$ http://www.website.com/index.php? [L,R=301] EDIT: I have an old php page in the shopping cart that I have transferred to the new address. So

Adding a Parameter at End of all url matching a format through Htaccess

对着背影说爱祢 提交于 2019-12-12 22:55:48
问题 Pl advise Pl advise, how to add Itemid=13 on end of all url matching by making 301 redirect index.php?option=com_usedtoy&view=post&id=**variable** For ex Incorrect URL www.abc.com/index.php?option=com_usedtoy&view=post&id=495 www.abc.com/index.php?option=com_usedtoy&view=post&id=497 www.abc.com/index.php?option=com_usedtoy&view=post&id=510 Correct URL www.abc.com/index.php?option=com_usedtoy&view=post&id=495&Itemid=13 www.abc.com/index.php?option=com_usedtoy&view=post&id=497&Itemid=13 www.abc

PHP header() redirect in Google App Engine

北城余情 提交于 2019-12-12 14:50:07
问题 I try to make a header redirect on an Google App engine instance with header("HTTP/1.1 301 Moved Permanently"); header("Location: http://".$location); header("Connection: close"); die(); It's working on my local development environment. On Google App Engine I receive the 301 but it doesn't redirect to the new location, instead there's a white screen. 回答1: It was a encoding problem. I had to urlencode() all parts of $location. On my local MAMP environment there was no problem. 来源: https:/

Is it okay to send a 301 redirect from https (if not in use)?

旧街凉风 提交于 2019-12-12 04:59:32
问题 I have my website hosted on the HTTP protocol, but my hosting service provides a default page when accessed through HTTPS. Since I'm not using SSL, from an SEO perspective, which one is more correct? a) toggle https for my website and do a 301 redirect to http://? b) just leave it like that (default https page from the web hosting co) 回答1: A would be the cleanest solution but it shouldn't really matter. Who, besides yourself, will be trying the https page? 回答2: I've seen problems with https