Can't get aliases to work

6 posts / 0 new
Last post
#1 Fri, 07/31/2015 - 16:25
uniqbuy

Can't get aliases to work

The main domain works fine. I have created an alias but it gives me a 403 error when I try to go on it. Any ideas?

Fri, 07/31/2015 - 22:42
andreychek

Howdy,

Hmm, is there any chance you could share the two domain names in question?

I'm curious if there's a DNS error of some sort that's causing the problem you're seeing.

The only other thing you might check, is to look in $HOME/logs/access_log to make sure you see an entry there when accessing the alias domain.

-Eric

Sat, 08/01/2015 - 07:42 (Reply to #2)
uniqbuy

Hi Eric

Thanks for your reply. The domains are www.uniqbuy.com and the alias www.uniqbuy.co.uk

Not sure what is causing the issue but I have added these rewrite rules in httpd.conf and it seems to have gotten around the issue.

RewriteCond %{HTTP_HOST} ^uniqbuy.co.uk [NC] RewriteRule ^(.)$ http://www.uniqbuy.com$1 [L,R=301] RewriteCond %{HTTP_HOST} =www.uniqbuy.co.uk RewriteRule ^(.) http://www.uniqbuy.com$1 [R]

Thanks Naz

Sat, 08/01/2015 - 10:22
andreychek

Howdy,

Hmm, as I access both of the domains you mentioned above, it takes me to the same website.

I'm not seeing any errors with either domain.

Are you still seeing an error when accessing the alias? If so, I'm wondering if you're experiencing a DNS caching issue.

-Eric

Sat, 08/01/2015 - 10:44 (Reply to #4)
uniqbuy

Hi Eric

It was not working using the alias tutorial when I posted the question.

But, then I added the following code to httpd.conf and it seems to have corrected it:

RewriteCond %{HTTP_HOST} ^uniqbuy.co.uk [NC]
RewriteRule ^(.)$ http://www.uniqbuy.com$1 [L,R=301]
RewriteCond %{HTTP_HOST} =www.uniqbuy.co.uk
RewriteRule ^(.) http://www.uniqbuy.com$1 [R]

However, not sure this is the recommended way of doing things.

Sat, 08/01/2015 - 11:43
andreychek

Nuts, my apologies, I missed the rest of your update when I responded. You did indeed say all that.

I was so excited when I saw the two domain names that I raced off and started testing :-)

I'm not quite sure why it wasn't working at the moment... however, there's nothing wrong with adding those rules to your httpd.conf file.

Those will also be included with any Virtualmin backups you make, as it makes a backup of the Apache config for your domain.

You should be good to go!

-Eric

Topic locked