.htaccess - Problems redirecting old domain to new with Apache and htaccess -


My homepage is located at www.nazgulled.net and I have purchased a new domain that is www.ricardoamaral.net. Both of these domains point to the same exact server.

I'm getting two problems with redirection, my current code is:

  rewrite% {HTTP_HOST} ^ (Www ..)? Nazgulled \ .net [NC] RewriteRule ^ (. *) $ Http://www.ricardoamaral.net/$1 [L]  

For now I just

Anyway ...

P> 1) This work Not doing, when I try, I can not reach "nazgulled.net", it gives me a "server internal error" and I do not understand why .. I do not understand why Because "google.com" replaces "ricardoamaral.net", the redirect works fine:

2) I have some subdomains May include and I would like to redirect all of them. My first choice is to add different redlight conditions / rules to each sub-domain, but there are several manual codes in it and if the user types some subdomain that does not exist, then they do not redirect it and I Also want to

For 1, you can use something like this instead:

  & lt; VirtualHost *: 80 & gt; ServerAdmin webmaster@nazgulled.net ServerName nazgulled.net ServerAlthough www.nazgulled.net Permanent / HTTP Redirect / http://www.ricardoamaral.net/ & lt; / VirtualHost & gt;  

I use a similar configuration and it works perfectly, keeping query parameters, paths, etc.

Your own rewrite rule Regardless of this, I have to keep in mind that if you do not include QSA, your query parameters may be lost

To diagnose internal server errors, just log in Vhost, or a global one, based on your configuration by your ErrorLog instructions Have a look at the provided log file. This should give you the exact reason for the error.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -