Hot answers tagged virtualhost
Change* DirectoryIndex index.html To DirectoryIndex index.php Or multiple : DirectoryIndex index.php index.html <VirtualHost *:4323> ServerName www.first.com ServerAlias first.com DocumentRoot /var/www/first.com DirectoryIndex index.php RewriteEngine on RewriteRule ^index\.html$ index.php$1 ...
I think you don't require this ->RewriteRule . -[E=REWRITEBASE:/mysitefolder/] since your DocumentRoot is already pointing to /var/www/mysitefolder/ . You can try commenting this rule or replace it with RewriteRule . - [E=REWRITEBASE:/] Hope this helps.
Simply ensure that your config is correct before you issue a restart/reload apachectl configtest configtest : Run a configuration file syntax test. It parses the configuration files and either reports Syntax Ok or detailed information about the particular syntax error. This is equivalent to apachectl -t.
I suggest you to use A record over CNAME in DNS settings to simplify the proceedings. Refer Differences between the A, CNAME, ALIAS and URL records Following vhost config would fulfill your requirement. 1) HTTP domain.one.com to HTTPS domain.two.com NameVirtualHost *:80 NameVirtualHost *:443 <VirtualHost *:80> ServerName domain.one.com ...
As I remember, if ServerName is not set, Apache use the server hostname as ServerName for default virtualhost, you should also see a warning about that on Apache logs or as output when you restart Apache. You can also workaround it adding ServerName directive to default virtualhost or globally in Apache conf, but I think that is a best practice to name the ...
You could also use DirectoryIndex index.php index.html for it to load .php first but if it does not exist (like the site runs on .html), then it will serve the .html file.
You have to bind the domain with IP address. <VirtualHost *:80> DocumentRoot /var/www/mysitefolder/ ServerName example.com ServerAlias www.example.com </VirtualHost> instead of this use: <VirtualHost example.com:80> DocumentRoot /var/www/mysitefolder/ ServerName example.com ServerAlias www.example.com ...
Only top voted, non community-wiki answers of a minimum length are eligible