Hallo guys, I uploaded some pages on my website (shared-hosted) and I would lik to add some subdomains. My control panel let me add a DNS entry so I did : download.mydomain.com. Pinging it from dos shell works well. I noticed that creating this subdomain a folder named "download" is automatically added to root level. I'm going to explain my folders structure: [root] ------>index.html ------>page.html ------>[download] ----------------> index.html ----------------> .htaccess I'm pretty sure that mod_rewrite is installed and working. I would like that browsing my site with this url: download.mydomain.com I actually browse at root level. So, if I call download.mydomain.com/page.html I can browse the one at root page. I don't mean redirect but I wish that in user address bar will remain download.mydomain.com. In previous configuration, using IIS, I can simply do this. Is it possible in Apache? I tried some rewriting script but none of them worked. Any help appreciated. Best regards. Fabri.
Try this: RewriteEngine On RewriteCond %{HTTP_HOST} ^download\.mydomain\.com$ [NC] RewriteCond %{REQUEST_URI} !^/download/ [NC] RewriteRule ^(.*)?$ /download/$1 [QSA,L] Code (markup):