Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I recently switched sites from janeullah.com (which had an A dns entry pointing to janeullah.zenfolio.com) to janeullahphotography.com. I'm on Dreamhost, currently have A record on janeullah.com going to blog.janeullah.com and using Google Apps for Email.

I'm trying to set up a rewrite rule which (for now) redirects anyone who clicks on janeullah.com/xxxx/xxx or janeullah.com/z/s/z to: janeullahphotography.com/xxx/xxx or janeullah.com/z/s/z

These are the .htaccess contents I've tried that didn't redirect

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://janeullahphotography.com/$1 [R=301,L] 

and

RewriteEngine on
RewriteCond %{HTTP_HOST} !^janeullah.com$ [NC]
RewriteRule ^(.*)$ http://janeullahphotography.com/$1 [R=301,L]

Typing in janeullah.com/weddings doesn't redirect to janeullahphotography.com/weddings and even when I entered garbage into the .htaccess file, nothing happened and makes me suspect the .htaccess file is being ignored.

Specific pointers about what I'm doing wrong will be greatly appreciated.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

I don't know why your htaccess isn't being honored. But my best guess is your host has disallowed htaccess overrides. You should contact them to find out.

As for the htaccess code, try this:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?janeullah\.com$ [NC]
RewriteRule ^(.*)$ http://janeullahphotography.com/$1 [R=301,L]
share|improve this answer
    
Thanks for your answer, John. I've contacted Dreamhost and will wait on their response. I noticed an error in my original question. I meant: "I'm trying to set up a rewrite rule which (for now) redirects anyone who clicks on janeullah.com/xxxx/xxx or janeullah.com/z/s/z to: janeullahphotography.com/xxx/xxx or janeullahphotography.com/z/s/z" –  janoulle May 20 '11 at 15:57
    
Your rule worked!! :D Thanks a bajillion times, John! :D I don't know if Dreamhost did anything on their end but the tech also noted that this line in my rules: "!^janeullah.com$ [NC]" was saying "NOT janeullah.com" –  janoulle May 20 '11 at 16:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.