NameSilo

Trouble with .htaccess redirects

Spaceship Spaceship
Watch

dan_Vt

Established Member
Impact
13
I'm having problems with something that should be easy.

I'm trying to make it appear that a site of mine has changed its domain name. I've parked newdomain.com with olddomain.com and have tried several 301 redirects in the .htaccess file, but when I go to the site it hangs and ultimatly I get a cannot find server.

I don't know if this has something to do with the fact that the pages of the site are php, and there is a forum. If someone could help I'd appreciate it.

Basically I need all directories redirected to the parked domain.

Thanks,
Dan
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
.US domains.US domains
Code:
RewriteEngine on
RewriteRule (.*)? http://www.redirecttothisdomain.com/$1 [R=301,L]
That's what I use. It redirects anything on the old domain to the same thing on the new one. If you don't want that, just remove the $1. :)
 
0
•••
Dan said:
Code:
RewriteEngine on
RewriteRule (.*)? http://www.redirecttothisdomain.com/$1 [R=301,L]
That's what I use. It redirects anything on the old domain to the same thing on the new one. If you don't want that, just remove the $1. :)

When I use that I get "The page isn't redirecting properly" in FireFox and in Internet Explorer it hangs for a while and does nothing.
 
0
•••
Do you have any conflicting .htaccess files?
 
0
•••
As far as I know there's only the one.
 
0
•••
Do you just want to redirect to the new sites homepage or is the new site EXACTLY the same with all directory structures the same?
 
0
•••
labrocca said:
Do you just want to redirect to the new sites homepage or is the new site EXACTLY the same with all directory structures the same?

Everything is exactly the same because the new domain is parked on the old one. If you go to the new domain you see the website with the new domain name...but I want people who use the old domain to see the new url in the address bar so that it appears to be the same site with a new name.

That make sense?
D
 
0
•••
What then happens in the above sample is that the user keeps getting redirected to the same document over and over as it does that regardless of what domain they access. Adding a rewrite condition on the host as per below would solve this:

Code:
RewriteCond %{HTTP_HOST} ^(www\.)*olddomain.com
RewriteRule (.*) http://www.newdomain.com/$1 [R=301, L]
 
0
•••
cerebus said:
What then happens in the above sample is that the user keeps getting redirected to the same document over and over as it does that regardless of what domain they access. Adding a rewrite condition on the host as per below would solve this:

Code:
RewriteCond %{HTTP_HOST} ^(www\.)*olddomain.com
RewriteRule (.*) http://www.newdomain.com/$1 [R=301, L]

Thanks for the help, but when I do that I get:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.


--------------------------------------------------------------------------------

Apache/1.3.37 Server at www.10000-days.com Port 80
 
0
•••
Anyone know why the above would happen?
 
0
•••
Apparently the correct answer is:

Code:
RewriteEngine on

rewriteCond %{HTTP_HOST} ^(www\.)?10000-days\.com$ [NC]
rewriteRule ^(.*)$ http://www.toolian.com/$1 [R=301,L]


D
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back