virtualhost keeps redirecting to deleted alias information
Asked Answered
S

1

2

I have a DigitalOcean droplet (i.e. a VPS server), with Ubuntu 14.04 and Apache 2.2.

I had 4 virtualhosts configured, with 4 different domains pointing to 4 different folders, no problem.

I needed to point a 5th domain (let's call it www.someshop.tld) containing a PrestaShop installation.

I added the following Alias to the apache2/sites-available/domain1.conf file so that www.domain1.tld/someshop would lead to www/prestashop, and it worked fine

<VirtualHost *:80>  
    ServerName www.domain1.tld
    DocumentRoot /www/directory1

    Alias /someshop /www/prestashop    #Alias line
</VirtualHost>

I did this as a temporary measure so I could have a working site publicly accessible, (so I could access www/prestashop publicly before I had configured www.someshop.tld DNS settings, 'A' record, Nameservers, etc.).

I now don't need to do this any more, so I deleted the Alias line from the .conf file so it looks like this:

<VirtualHost *:80>
    ServerName www.domain1.tld
    DocumentRoot /www/directory1
</VirtualHost>

and added a new someshop.conf that looks like this:

<VirtualHost *:80>
    ServerName www.someshop.tld
    DocumentRoot /www/prestashop
</VirtualHost>

I then re-enabled both the .conf files in apache2/sites-enabled, and restarted apache with service apache2 restart.

However, when I go to www.someshop.tld, it continues to do a URL redirect to www.domain1.tld/prestashop (where there's this message: "Not Found, The requested URL /someshop was not found on this server").

I waited for a couple of hours before posting this question because I thought it might just be a "propagation" issue. So far it's still doing this.

My question: is this something that should clear up by waiting for it, or do I need to fix something else? E.g., is there some way for me to flush the old virtualhost Alias information?

Slier answered 26/6, 2016 at 19:10 Comment(3)
have you seem apache log fie ?Prisca
Does this also happen on other machines/browsers that have never been to the domain? Just to rule out a caching issue. Not sure how browsers cache redirects, but I think I've seen instances of it happening.Calendre
What about prestashop url settings in the backoffice, did you change them too?Coracorabel
D
0

Have you tried removing the site from apache config?

$ sudo a2dissite test.com.conf  #Remove symlink
$ sudo service apache2 reload

This would remove the symlink. You can then create the symlink again with the proper configurations that you like.

Daytoday answered 19/6, 2017 at 8:18 Comment(1)
Is there any reason a symlink would persist even if the .conf file was deleted entirely? I'm somehow getting a phantom redirect to a virtual server that I've deleted.Petronella

© 2022 - 2024 — McMap. All rights reserved.