Mobile app version of vmapp.org
Login or Join
Hamm4606531

: Mod rewrite help needed to redirect old domain to new domain I recently switched sites from janeullah.com (which had an A dns entry pointing to janeullah.zenfolio.com) to janeullahphotography.com.

@Hamm4606531

Posted in: #301Redirect #Htaccess #ModRewrite

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 (.*) janeullahphotography.com/ [R=301,L]


and

RewriteEngine on
RewriteCond %{HTTP_HOST} !^janeullah.com$ [NC]
RewriteRule ^(.*)$ janeullahphotography.com/ [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.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Hamm4606531

1 Comments

Sorted by latest first Latest Oldest Best

 

@Sarah324

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 ^(.*)$ janeullahphotography.com/ [R=301,L]

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme