Tag Info

Hot answers tagged


Use this: location = / { return 301 http://example.com/blog; } The key here is the =, which makes nginx apply this rule only to requests arriving to root folder, nowhere else.


First of all, if you have access to server configuration, you should not use .htaccess as it slows down your Apache. Also, it is much easier to handle this with two separated virtual hosts. 1) /etc/apache2/sites-enabled/000-default (for IP and non-specified hostnames): <VirtualHost *:80> DocumentRoot /var/www/html </VirtualHost> 2) ...

Only top voted, non community-wiki answers of a minimum length are eligible