http-status-code-301

Ruby on Rails redirect how to pass params in routes file

时光毁灭记忆、已成空白 提交于 2019-12-05 12:12:29
We recently changed the product name on our website from 'bracelets' to 'wristbands' and need to keep the old routes around for SEO purposes. Essentially, these routes www.hostname.com/products/bracelets/series-1/ www.hostname.com/products/bracelets/series-1/small-purple should route to www.hostname.com/products/wristbands/series-1/ www.hostname.com/products/wristbands/series-1/small-purple I am reading the tutorial here http://guides.rubyonrails.org/routing.html#redirection and looks like i'll be using the block syntax, but am still not sure how to do the route properly. I'm looking to learn

Zend Framework: How to 301 redirect old routes to new custom routes?

♀尐吖头ヾ 提交于 2019-12-05 06:57:24
I have a large list of old routes that I need to redirect to new routes. I am already defining my custom routes in the Bootstrap: protected function _initRoutes() { $router = Zend_Controller_Front::getInstance()->getRouter(); $oldRoute = 'old/route.html'; $newRoute = 'new/route/*'; //how do I add a 301 redirect to the new route? $router->addRoute('new_route', new Zend_Controller_Router_Route($newRoute, array('controller' =>'fancy', 'action' => 'route') )); } How can I add routes that redirect the old routes using a 301 redirect to the new routes? Vadyus I've done it like this Add a Zend_Route

Creating Canonical URLs including an id and title slug

感情迁移 提交于 2019-12-05 06:26:14
问题 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? 回答1: 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 =

.htaccess - 301 redirect if no query string present

流过昼夜 提交于 2019-12-04 19:56:51
i would like to create a 301 from a page to the same page except that the destination page has a parameter in the url. Browsers show me an error (too many redirects) so its seems that there is an infinite loop. This is my code: RewriteEngine on Redirect 301 /index.php http://www.monsite.com/index.php?step=1 thanks to advice me for that :D You need to conditionalize the redirect and do it in PHP to prevent the infinite redirect loop. index.php: if(!isset($_GET['step'])){ header('Location:http://www.monsite.com/index.php?step=1'); } The way you have it configured will redirect indefinitely,

Client Web Browser Behavior When Handling 301 Redirect

与世无争的帅哥 提交于 2019-12-04 15:56:01
问题 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

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

我只是一个虾纸丫 提交于 2019-12-04 14:38:24
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 know nothing...). I guess it's easy to do with IIS, but GoDaddy doesn't give you IIS access. So is

Sharepoint 2010 search cannot crawl mediawiki site

我们两清 提交于 2019-12-04 11:22:09
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. By default, all links crawled are converted to lower case by the SharePoint search indexer. You will need to create case sensitive crawl rules. Have a look at the following post: http://blogs.msdn

Facebook like count resets after a 301 redirection

大城市里の小女人 提交于 2019-12-04 07:46:31
I have an article on my site that has published in a wrong category. I wanted to change the category, and since the category name is part of the url, I than added a 301 redirection to the updated url. That article had also several likes, but after the 301, it was reset to 0 likes, since to Facebook this is now as a new url with no likes. If I remove the 301 than the likes count is updated again. Is there a way to notify FB that a certain url is a result of a 301 that has likes count? I assume it is relevant as well for pages with FB comments You would need to set the "href" or "data-href"

php 301 redirects actually doing a 302 redirect

不羁的心 提交于 2019-12-04 06:28:49
问题 I have been googling for this but no one appears to have the answer. This post describes the problem well: http://www.mail-archive.com/php-general@lists.php.net/msg198576.html Server is Windows 2008 FastCGI PHP 5 回答1: It appears that the only answer to this one at the moment is to not use FastCGI on IIS7 when using PHP (because of a bug in FastCGI) - which is rubbish because it's very quick. Using isapi allows the 301 redirects to work as they should, but it's not as fast. 回答2: microsoft

Can a 301 page be crawled by google?

六眼飞鱼酱① 提交于 2019-12-04 05:33:07
Is it possible for google or any other crawler to crawl and index a page which returns a 301 status code? I have seen a page in google, which has had a 301 for months. However the cache date of that page in the index is from a few days ago. Can google just ignore the 301 and crawl the contents of a page? Google always crawls the target of a redirect, HTTP 301 is not an exception. Could not find a better source than one employee's discussion post , though. Google Search Appliance documentation says the same and I don't see why GSA and GoogleBot should handle redirects differently. Normally