I am running Apache on Ubuntu. My /var/www folder consists of two directories
/codeigniter /wordpress
I would like mydomain.com to point to /codeigniter and mydomain.com/blog to point to /wordpress. I have acheived the first one but not the second.
I have the following in site-available/mydomain.com
<VirtualHost *:80> ServerAdmin [email protected] ServerName www.mydomain.com ServerAlias mydomain.com # Index file and Document Root (where the public files are located) DirectoryIndex index.html index.php DocumentRoot /var/www/codeigniter/public <Directory "/var/www/codeigniter/public"> Options FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>
This works and when I go to mydomain.com in my browser it takes me to my codeigniter directory. However how can I make apache take me to my wordpress directory when I go to mydomain.com/blog?
Apache Virtual Hosts are a feature which let you host multiple independent websites from one Apache installation. Each site has its own filesystem directory and domain name. You can serve different sites to different visitors based on the domain they're using.
<IfModule> is simply a directive that tests the condition "is the named module loaded by apache httpd" (in your example mod_expires). It allows people to produce conditional based configuration for different installations where certain modules may be present or not.
Simple, add an Alias and another directory block inside your VirtualHost
block:
Alias /blog/ "/var/www/wordpress/" <Directory "/var/www/wordpress/"> ... whatever you want ... </Directory>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With