Cannot seem to get domain alias to work--i'm getting 404 errors

#1
I am new to openlitespeed, and am figuring I am missing something pretty basic (And embarrasingly simple) but I am at my wits end.

what I am using
I am using openlitespeed as part of the new package at digital ocean.
I have setup several wordpress domains successfully and have them using ssl.

What I need to accomplish
I am moving bestnashvillebillboads.com to portions of huttonadvertising.com, both to be hosted on this new server.
So best nashvillebillboards should be an alias that point to huttonadvertising.com. Technically, it should redirect page for page so that I do not get hit with SEO penalties.
With one exception. nashvillebillboards.com/pagename/ should forward to huttonadvertising.com/pagename. The one exception is that bestnashvillebillboards.com should got to huttonadverising.com/billboards/

What I have done
I have created the virtualhost and listeners for huttonadvertising
I tried creating a virtualhost for bestnashville... but that didn't help
In the vhosts setup--in the general tab, there is a place to enter an alias. I have entered bestnashvillebillboards.com and www.bestnashvillebillboards.com as aliases.
I have setup listener on 80 and ssl(443) for huttonadvertising
I have created a letsencrypt ssl certificate for huttonadvertising that includes both domains--so I know the system is finding bestnashville...

What happens
huttonadvertising is working like it should and it only shows https pages. It is a wordpress site.
all I can get for bestnashvillebillboards is a 404 error. I cannot figure out what is missing. It finding the domain but not finding the ability to deliver the html. I have tried different file types (php and txt) nothing but 404 errors.
 
#3
I tried that and either I didn't get the rewrite rules done correctly or something else is mixed up. I ended up solving the issue by creating another vhost record and listener and the using rewrite rules in the vhost to point to the vhost I wanted.

Regardless, what is the point of an alias listing in a vhost record if it doesn't automatically point the alias record to the main domain?
 

Pong

Administrator
#4
are huttonadvertising.com, nashivillebillboards.com, bestnashvillebillboards.com WordPress multisite setup? or different virtual host and different wp installation?

If they are domains for the same virtual host, you can add the domains to map to the same virtual host.
https://openlitespeed.org/kb/setting-up-name-based-virtual-hosting-on-openlitespeed/

if you have a lot of such redirections for for multi-domains under the same virtual host, you will need to get your rewrite condition and rewrite rule right, otherwise it may be problematic. The separate virtual host could be less complicated on rewrite rule side and could be easier to get them right.
 
#5
nashvillebillboards is not a domain we are worried about.

The same billboard content is served by the two sites--so it is effectively one single-site worpdress installation. For SEO purposes one has to be redirected to the other one. If I (google) can see the same thing with two different URL's, then I get penalized in SEO.

I attempted to follow the instructions in the link. Otherwise, I wouldn't have either site working at all. (I happen to have both working, I am looking for a more elegant solution.)

If I setup bestnashvillebillboards with its own vhost, add the vhost to the listener, and add the rewrite rules in the vhost for bestnashvillebillboards.com to redirect the way I want to Hutton Advertising it works.

I am currently using the following rewrite rules in the vhost :

RewriteCond %{HTTP_HOST} bestnashbillboard\.com$ [NC]
RewriteRule ^(.*)$ https://huttonadvertising.com/ [L,R=301]

RewriteCond %{HTTPs_HOST} bestnashbillboard\.com$ [NC]
RewriteRule ^(.*)$ https://huttonadvertising.com/ [L,R=301]


However, if I setup bestnashvillebillboards as an alias to huttonadvertising in the vhost, I get a 404 error. This would appear to be the more elegant solution that I am looking for. If this alias approach doesn't work, why is their an alias setting?--It appears to do nothing useful. If I use a cpanel setup, I can setup an alias domain and it shows the same content without fussing with me.
 

lskagan

Administrator
#6
When you set it as an alias in the vhost can you check the error log to see what file it is trying to find for it throw a 404 error?

Another solution for you might to be add bestnashbillboard.com as a Domain under the virtual host mappings for huttonadvertising.com.
 
#7
I cannot find anything in the logs. I have it recording some of the re-write information. But a 404 error is essentially a we cannot find the resource error. To make looking in the logs easier, I reset the system back to using the alias long enough to access the system and see what would happen.

I have a system that works, but it just seems like the alias feature should work. Otherwise, i cannot find a good reason for it.
 

Pong

Administrator
#8
domain name and domain name alias should work. can you log a ticket with your tmp root ssh login, we can check for you.
 
#10
Hi! If you registered a domain and a little time has passed, perhaps your domain has not yet been registered in all DNS databases
You can read about the DNS update time in the domain description on the domain registration website. It is also important that this is a unique domain with unique logos and other data. To learn more about how to do this, click here. After a while, your site will start working with the registered domain name if it meets all the requirements.
 
Top