Simple question I own a domain and from that domain i want to redirect users who opens my old domain URL to my New Domain URL.
16372
This question is here so we can offer users who are looking for information on how to make one or more common or basic redirects in Apache using the htaccess file. All future questions pertaining to finding information that is that is covered by the question should be closed as a duplication of this question. .  Whats the point in this question? The idea while not perfect is catch the most commonly asked questions regarding redirects using the  htaccess on the Apache platform either on  some type of lamp or a live server. The type of answers should be generally those that you could imagine are used by 100,000’s of sites world-wide and are constantly asked here at Pro Webmasters repeatedly over and over in various forms.  A few examples of the type of answers we are looking for:   How can I redirect non-www to www? How can I redirect a sub domain to the main domain? How can I redirect a sub folder from domain to a root or a subdomain?  How can I redirect an old URL to a new URL?   A few examples of the types of answers that we are not looking for:   Answers that do not involve a redirect. Any answers relating to NGinx, IIS or any other non-Apache platform. Answers that involve custom and complex string or query removals.   Resources for Advanced to Complex Mod_Rewrite Rules:      Please note: that this question is still in construction and may need some refining either by myself or a real moderator of Pro Webmasters, if you have any concerns or questions .
8605
Someone has pointed their domain (www.bomberball.net) to the same IP as my domain (www.kapparate.com) , and Google is now showing the former when searching for Kapparate, rather than the latter. What's the best way to block requests coming from www.bomberball.net ?
48829
This is a  about redirecting from http to https in Apache Related:     I have an Appache web server which serves both http://example.com/ and https://example.com/. I want to redirect all http requests to https. Currently I'm using this .htaccess rule to redirect http requests to https. RewriteEngine On RewriteBase / RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}   It's working as expected for example.com but the same rule is not working for sub links, when I access existing links, like example.com/about it will still load in http, no redirection happens for existing links. How can I make Apache redirect all http requests to https?
5695
I recently moved from having a main site like www.example.com with a subdomain associated site yyy.example.com, to moving everything off the subdomain to a subdirectory like www.example.com/yyy/, with the same hierarchy underneath the subdirectory, and now yyy.example.com is just a redirect page to the subdirectory, so yyy.example.com/abc/page-x is redirected to www.example.com/yyy/abc/page-x and so on.  The effect has been that the traffic increased by several times (the total page views are more than ten times at the present rate) what it was to the yyy subdomain. Previously almost all of the traffic to the yyy subdomain was from the www site. This is from monitoring the old yyy site for a year or more.  I'm curious to know if there's any research or results which would indicate whether this is universal (subdirectories beat subdomains) or "just me".
38246
There is a site of ill-repute known as thedirty which has completely mirrored my site and now has links appearing on Google at the #1 spot using my content.  I checked my log files and noticed that this site has been crawling mine for sometime, and also has 10,000 links from their site to mine.  I have blocked user access which is referred from this site and reported them as web spam to Google already.  I also disavowed the domain.  How are they getting top links in Google (even overtaking mine) for such nefarious tactics?  What are the steps to completely eliminating an issue such as this?  UPDATE 8/28/2014:  I thought I would provide an update on this as I have more information now.  So thedirty pointed their subdomains to my ip which had the effect of making their subdomains look like my website.    For a couple of days this didn't matter much because using htaccess, I redirected all HOSTS not of my domain, back to my domain which basically meant I was getting their subdomains traffic links on Google.  After a couple of days thedirty changed their subdomains to point back to their website so that I no longer benefit from this.  So the whole point being they used my content to get top ranks on Google, and are now pointing those links back to their website to drive more traffic to theirs.  It is a dirty tactic by a dirty website.  My hope is that Google punishes such behavior.
72337
I've got a domain that I apparently forgot to set a preferred domain for, so I just tried to do it. Webmaster Tools instead popped up a little box:     Part of the process of setting a preferred domain is to verify that you own http://www.example.com/. Please verify http://www.example.com/.   I'm running into some problems following these instructions:   As far as I can tell I already did verify sometime in the past. There's a TXT DNS record with the gibberish Google tells you to set for it that I couldn't have come up with myself. …and nothing is telling me this information is bad. So let's assume the site is somehow not actually verified. All  instructions start with "click the Manage Site button next to the site you want, and then click Verify this site." That button doesn't even exist on my screens. (It presumably goes away when you successfully verify?) Those instructions were all updated pretty recently, and the DNS one in particular just a couple weeks ago so it seems a bit unlikely they're inaccurate.   I am not using Apps, and won't be, so can't try out the verification .   Note that I also have another domain that I have not done any verification for which is showing the same behavior(no such button, being told to verify when it seems impossible etc.) so something appears to just be broken.  I already have a no-www process in place server-side, so we can skip that. I'm just trying to get the box checked off in GWT.  If I don't get any resolution, I'll eventually scrap the TXT record and see if the site gets un-verified(or whatever since it thinks it isn't), and see if I can just restart the process.  It's not urgent so I'm just trying to figure out if I've gone blind to something or what. Did the button move?
35684
I have this in my .htaccess (modified from the default Drupal .htaccess):  RewriteCond %{HTTP_HOST} ^www\.website.com\.com$ [NC] RewriteRule ^(.*)$ http://website.com/$1 [L,R=301]   In theory this will redirect something like http://www.website.com/asdf to http://website.com/asdf. However, it doesn't redirect, it allows requests to go through like there was no redirect intended.  (I'm on OS X if it matters, but I've also tried it on a Network Solutions Linux server with the same result.)
58872
Imagine my competitor is getting 1000s of views a day and is established in Google search engine.  I plan to launch my website in a weeks time but will have to work hard to get into google search results  If my competitor has the domain www.example.com , can I buy the domain www.example.co.uk and then redirect that to my website?  I figure some people may accidentally put .co.uk instead of .com  Would this me illegal in any way , or is it fair game as they haven't bought the domain, meaning I could possibly look to selling it to them?
7625
You can reach this IP address  (if my computer is online). I want to assign a domain to it so I wonder how is that possible when I have no DNS? I do own my domain which is ".com". My IP is static.  Thanks
28256
I had an old domain that I have deprecated, but 301 redirected all results from it to my new site.  The new site is now receiving a decent amount of traffic, but I don't know if it's 301 redirected from the old site, and doing a site:[old site] still shows several thousand pages indexed.  Since all pages from the old site are 301 redirected, will they ever be removed from the index, as long as the old domain name is active?  As a rule of thumb, somewhere I got 90 days for any significant site changes.  When is it safe to burn the old domain?
590
I would like to redirect www.example.com to example.com. The following htaccess code makes this happen:  RewriteCond %{HTTP_HOST} ^www\.example\.com [NC] RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]   But, is there a way to do this in a generic fashion without hardcoding the domain name?
4730
I have been told by an SEO company to redirect the site IP to the domain using a 301 redirect. This will apparently improve the SEO ranking of the site. The site has a dedicated IP address.   Is this worth doing and should it be done ?
57888
I have a custom module that displays a form.  Upon submitting the form, I want to redirect the user to a different page.  How can I do that?
81859
I had a very long domain, so I decided to change it to a shorter and more friendly one. But since I have a lot of subdomains (in fact, I have a subdomain wildcard), I wanted to keep the subdomain while changing only the domain part. So, I made the following rule:  server {   listen 80;   server_name ~^(\w+)\.olddomain\.com$;    rewrite ^ $scheme://$1.doma.in$request_uri? permanent; }   I have read a lot of other questions where this snippet solved the problem. But with me, Nginx always redirects to .domain.in, without any subdomains. What am I missing? I have tested the regex against regex101 and the examples work fine, Nginx seems unable to redirect it.
58618
I have two domains (.com and .co.uk) with different websites. In .co.uk domain I have a good ranking and my idea is to redirect the .co.uk domain to .com. I think I have to use 301 redirect.  My questions is, I have two different websites, the two websites are different but with the same categories and some products, I have to create only one redirect of home to home or a should create other pages like similar products, categories and other similar pages in both sites?  The created backlinks usually goes to homepage, so I thought I just needed to redirect the homepage.  I don't want to lose the ranking and have problems with Google crawl.
116849
I run several different web pages on different servers (with different IP addresses). These pages are linking to each other in order to boost number of backlinks pointing to my pages.   I would like to move all those projects to a single virtual host (with a single IP address). My question is, how Google handles links within different domain names but same IP address. Is there some penalization for it? Could this lead to lower PageRank?
112581
We're launching new website with new url structure and new content. Domain is the same. Many old pages are indexed by google. Should I use 404 or 301 and redirect to '/' for these old resources? I also want to remove these pages from google index.