virtualhost keeps redirecting to deleted alias information

﹥>﹥吖頭↗ 提交于 2019-12-11 00:53:52

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/38042221/virtualhost-keeps-redirecting-to-deleted-alias-information

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!