I have, for example site1.com, site2.com, configured with their own virtual hosts in their own files in the apaches enabled and available folders, in their own physical folders on the server and with different .htaccess and they are working fine. Now I want all the other domains that are not separately configured (for example site3.com, site4.com ....) to have one same virtual host, same physical folder, and to execute the same /folder1/folder2/index.php file. So far, I've made some virtual hosts but all I get is "It's working", probably because everything is redirected from the default virtual host to the /var/www. But if I set the DocumentRoot directive in that file, the .htaccess for some reason is not working, and I said that for the defined sites are working OK. What the virtual host file should be called, what should be it's content?
相关问题
- Backbone.js PushState routes .htaccess only workin
- Stop .htaccess redirect with query string
- .htaccess rule, redirecting old unexistent address
- What is this file in .htaccess?
- If statements in .htaccess files, to enable passwo
相关文章
- Multiple htaccess rewrite rule
- AWS ALB redirect to https
- rewrite urls for product name
- Codeigniter remove index.php - htaccess localhost
- How can I build the regex to match a string NOT co
- Relative paths from file for img, a and header
- Use bottlepy and php in the same computer
- How to change the name of the directory in url in
You can define a VirtualHost container that has as many ServerAlias entries as you need.
Here's a very simplified example:
If you've already tried creating vhost files, have you restarted apache?
Where to put the vhost files depends on what distro you're using. If you're not familiar with where stuff goes on your distro, check http://wiki.apache.org/httpd/DistrosDefaultLayout.