Here is the problem I have - there are a dozen (will be more) of domain names, let's call them mydomin1.com, mydomain2.com, ... mydomain12.com (the names will be absolutely different - no common pattern). The idea is to rewrite url based on the host name. I will set up folders accordingly, so we will have: /content/default/domain1.com /content/default/domain2.com .... /content/default/domain12.com DNS is set up to go to one web server, that web server has a default folder /content/default I also have .htacces in /content/default. Here is the code: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} (.*)$ [NC] RewriteCond %{REQUEST_URI} !^/%1/.*$ RewriteRule ^(.*)$ /%1/$1 [L] Code (markup): So the idea is when user goes to http://mydomain1.com the url is rewritten to /content/default/domain1.com. The above example works if I will use the actual domain name instead of %1. Any suggestions how to fix that?
what EXACTLY is the reason why you want to do simple things in a much complicated way ? I am sure you belief to have good reasons default apache usually is each domain has its own folder on server each domain has its own apache config file each domain has its own access configuration that allows individual modificat0ion and optimization as needed it also allows possible selling of site or designation of site-caretaker ( within own family for example ) such simple default configuration WITHOUT rewriting sutff is covered entirely in the section apache2/vhosts.d of your apache configuration one day your sites or one of them gets grown up - has real traffic and needs own server for faster page loading having sites separately as done by default apache config gives later flexibility default apache configuration has a sever wide config file and a domain relevant config file or section to make things easier for YOU.
Yeah i was going to say, wtf.. mod-rewrite for domains? Just use your control panel - addon domains... Or virtual host entries.