Questions tagged [http-status-code-301]

The 301 or Moved Permanently error message is a HTTP standard response code indicating that the requested resource has been assigned a new permanent URI. Future references should use one of the returned URIs.

1797 questions
4
votes
1 answer

Do WCF REST services support HTTP 301 redirects?

Is it possible to implement a HTTP 301 redirect for a WCF REST Service so that URLs of the form: http://server/customers/?name=John redirects to http://server/customers/324 (For the client-side case of this question, see Does the WCF REST…
Jacob
  • 22,785
  • 8
  • 39
  • 55
3
votes
4 answers

301 Redirect directly in HTML file

I have changed some file names on my web and now I want to make "301 Permanently Moved" redirect from the old files to the new ones. The problem is that my web is made completelly by static html pages and all 301 redirect tutorials decribe how to do…
user20353
  • 1,293
  • 4
  • 15
  • 28
3
votes
1 answer

using .htaccess for REST does 301 redirect

I'm trying to build an extremely simple RESTful test rig for an app I'm working on. I'm using .htaccess to redirect urls to my controller script where I will parse the urls to handle the logic. I have the redirect working, but the problem is that…
Geuis
  • 41,122
  • 56
  • 157
  • 219
3
votes
3 answers

301 Redirecting URLs based on GET variables in .htaccess

I have a few messy old URLs like... http://www.example.com/bunch.of/unneeded/crap?opendocument&part=1 http://www.example.com/bunch.of/unneeded/crap?opendocument&part=2 ...that I want to redirect to the newer, cleaner…
user84643
  • 379
  • 2
  • 5
  • 15
3
votes
1 answer

How do I programatically 301 redirect in an asp page?

I'm upgrading some classic asp pages to .net, but not all of them. Rather than go and modify all the links in this backwards system, which pulls some of its links from a cms data store. I would like to take advantage of http and just remove the code…
DevelopingChris
  • 39,797
  • 30
  • 87
  • 118
3
votes
1 answer

301 Redirects (htaccess) with exclude conditions

I'm currently moving a site (shop) to a new domain and putting in its place a non-shop version (made in wordpress) of the site. The aim is for most of the urls to redirect to the new domain except the few pages that the new site has. I've found…
dciso
  • 1,264
  • 3
  • 18
  • 31
3
votes
2 answers

redirect ssl to non ssl

I am trying to rediret from ssl back to non ssl in apache and I am not having any luck. Can this be done via htaccess? RewriteEngine On RewriteBase / RewriteCond %{HTTPS} on RewriteCond %{HTTP_HOST} www.mydomain.org RewriteRule (.*)…
Brian Barthold
  • 1,593
  • 4
  • 22
  • 39
3
votes
3 answers

302 Redirect set by Magento, 9300 Crawling errors

I have a SEOMOZ Pro account, and after crawling we have 9300 Warnings, and 90% of them are because of 302 redirect errors. It looks like its something with the compare feature. URL: http://goo.gl/Dg1jY 0 Errors No errors found! 1 Warning 302…
Luis Valencia
  • 32,619
  • 93
  • 286
  • 506
3
votes
1 answer

NextJs - How to redirect to a new URL with 301 status code?

NextJs - I am trying to redirect from /index.html to / URL using below code, module.exports = { async redirects() { return [ { source: '/index.html', destination: '/', permanent: true, }, ] }, } By referring…
Shruthi R
  • 1,863
  • 4
  • 39
  • 77
3
votes
2 answers

How do I use .htaccess to force www. while using Zend Framework

I want to force a www. prefix on my website by using a .htaccess 301 redirect. I am currently trying: RewriteCond %{HTTP_HOST} ^mysite.com [NC] RewriteRule ^(.*)$ http://www.mysite.com/$1 [L,R=301] Which normally works, but I am using Zend…
3
votes
1 answer

Avoid .htaccess inheritance

I have an .htaccess in root directory to redirect to a subdomain. RewriteEngine on RewriteCond %{HTTP:Accept-Language} (en) [NC] RewriteRule .* https://en.domain.com [R,L] In the same directory I also have my assets folder though and since is…
3
votes
1 answer

301 Redirects in CakePHP 3

I'm new to CakePHP. I have a website that was built by someone else in CakePHP 3.3.16. There are links to website.com/page and also website.com/page/. What's the best way to get /page/ redirecting to /page without affecting anything else that might…
sdexp
  • 756
  • 4
  • 18
  • 36
3
votes
2 answers

Does PHP's file_get_contents cache a 301 status code?

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
mr-euro
  • 2,732
  • 5
  • 23
  • 27
3
votes
1 answer

How to make open graph links work with 301 redirects

I am using friendly URLs on a VB.NET application and I was sharing the URLs on social media and the image preview was working fine. The link can be shared as follows: example.com/news/123 or example.com/news/123/hello-this-is-an-article To avoid…
3
votes
3 answers

301 redirection not redirecting to the right URL without a trailing slash

I have to manually redirect few URLs in my website1 to website2. Below is my code in the .htaccess file of website1 Redirect 301 /post1/ https://www.website2.com/post1 When I enter https://www.website1.com/post1/ in the browser it's being…
Anirudh
  • 2,767
  • 5
  • 69
  • 119