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
6
votes
2 answers

301 redirect to new domain with same url structure

I have a Magento website that is moving to a new domain. Im looking to 301 redirect all pages from the old domain to the new domain keeping same url structure. I've updated the .htaccess file on my old domain with: RewriteEngine On RewriteCond…
user1231561
  • 3,239
  • 6
  • 36
  • 55
6
votes
1 answer

htaccess redirect url with parameters

I have hundreds of links like this: http://www.domain.com/index.php?tag=value I want to redirect all links to http://www.domain.com/value/ Example: Link1 http://www.domain.com/index.php?tag=LW1fdX49tR redirect to:…
user2151960
  • 185
  • 1
  • 1
  • 17
6
votes
2 answers

Global 301 redirection from domain to www.domain

could i use the begin request of Global.asax to redirect everything, from mydomain.domain to www.mydomain.domain? If this one is true, how can i do that?
OrElse
  • 9,709
  • 39
  • 140
  • 253
6
votes
5 answers

Can a 301 page be crawled by google?

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…
user1721135
  • 6,864
  • 8
  • 34
  • 63
6
votes
2 answers

difference between RewriteRule ^(.*)$ & RewriteRule (.*)$

When moving all pages from old domain to new domain, i noticed some people added a ^and other not in rewriterule What is the different between RewriteRule ^(.*)$ http://mynewdomain.com/$1 [R=301,L] and RewriteRule (.*)$ http://mynewdomain.com/$1…
Nick321
  • 151
  • 1
  • 2
  • 6
6
votes
1 answer

How do browsers cache 301 redirects with query strings

I'm looking to put in a 301 redirect to an application for specific values of a query string parameter. For Example: http://www.example.com/page?id=1 → redirect to a new page http://www.example.com/page?id=2 → render normal response How do…
jkelley
  • 2,570
  • 3
  • 21
  • 24
6
votes
3 answers

.htaccess 301 redirect all pages on old domain to a single page on new domain

I'm looking to redirect each and every page on the old domain to a single page on the new domain. It should also redirect both the www and non-www versions. Every single request to the domain old.com, whatever it may be, should lead to www.new.com…
Dan Horvat
  • 800
  • 3
  • 14
  • 27
6
votes
2 answers

301 redirect will not work with %20 in url

I am trying to create this redirect: Redirect /commercial%20work.html http://nataliearriolaphotography.com/fine-art-photography-prints.html The problem is that when I first created this page I left a space in the file name. In other words it was…
evangelion3258
  • 77
  • 1
  • 2
  • 7
6
votes
1 answer

htaccess 301 redirect issue with url variables

If I use this code, it's successful: Redirect 301 /products.php http://website.com.au/product_123.php But if I do this, it isn't: Redirect 301 /products.php?id=123 http://website.com.au/product_123.php Note the variable in the url is what's…
cardi777
  • 563
  • 2
  • 9
  • 22
6
votes
2 answers

url shortener 301 redirection understanding

We're working on a URL shortener project in PHP. We're using 301 HTTP redirection and naturally track our links visits. but there is something strange : After we shorten a URL and go through it by a browser, only the first visit is tracked, and it…
Aliweb
  • 1,891
  • 3
  • 21
  • 44
6
votes
1 answer

301/302 Redirect not working in Android (work differently in different versions)

When using a URLConnection, the 301 redirect doesn't work, doesn't even show a Location header, using getHeaderFields(). It is a blank list, except in newer Android (I tested 4.1 and it worked). It looks like something this has been reported in the…
NoBugs
  • 9,310
  • 13
  • 80
  • 146
6
votes
1 answer

Is this C# action method code actually firing a 301 redirect?

Here is the code I use when someone visits a product page on my ecommerce website. public ActionResult Details(int id, string slug) { using (var productRepository = new EfProductRepository()) { var product =…
Only Bolivian Here
  • 35,719
  • 63
  • 161
  • 257
5
votes
1 answer

PHP CURL follow redirect to get HTTP status

I created the following PHP function to the HTTP code of a webpage. function get_link_status($url, $timeout = 10) { $ch = curl_init(); // set cURL options $opts = array(CURLOPT_RETURNTRANSFER => true, // do not output to browser …
floatleft
  • 6,243
  • 12
  • 43
  • 53
5
votes
2 answers

Redirect 301 from a Directory to a Single File

I'm having a bit of trouble figuring out something that should be simple. I want to 301 redirect everything in a directory to one single file in a new location. In my .htaccess, I've already tried the following... Redirect 301 /myDir/…
Sparky
  • 98,165
  • 25
  • 199
  • 285
5
votes
1 answer

Facebook like count resets after a 301 redirection

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…
Maor Barazany
  • 761
  • 2
  • 11
  • 21