Offistart - Virtual Offices, Office Space, Business Support Services
*Home>>>Virtual Address

Using Mod_Rewrite, how can I make a virtual subdomain show the information on a folder without redirecting?


For example someone enters in something.mydomain.com, and if the folder mydomain.com/something exists then it will display the data on mydomain.com/something without changing the address bar (which has something.mydomain.com in it). I have put together this code, which sort of works, but the problem with it is that it redirects, changing the address bar from something.mydomain.com to mydomain.com/something.

Options +FollowSymLinks
Options +Indexes
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !www.mydomain.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www.)?([a-z0-9-]+).mydomain.com [NC]
RewriteRule .* %2 [L]

Thanks for all future help.

Bider: it did not work.

This should work:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^([^.]+)\.mydomain.com(:80)?$
RewriteRule (.*) /%1/$1 [L]

... Interesting. I have just tried it in one of my test boxes and it worked just fine. What happened when you went to subdomain.mysite.com? Did it issue a redirect? Did you put the directives inside the correct <VirtualHost>?

Tags
  Business Address   Call Forwarding   Call Handling   Answering Service   Telephone Answering   Mail Forwarding   Virtual Address   Virtual Assistant   Virtual Business   Virtual Offices
Related information
  • What's a good virtual horseracing game on the internet???

    ...

  • Can changing your MAC address damage your network card?

    No. Changing the MAC address will not physically damage the NIC. You can change the MAC address on your PC without too much trouble. Check the reference links below. That said, you should r...

  • What is Virtual Magic Kingdom?

    well, It's Made To Be Accessable By Many Ages, But Since It's Disney, They Had To Make It Safe And Avalable For The Younger Audiences.. One Of The Things They Did For That Is A Dictionar...

  • What is a good birthday present/valentines day gift to send a virtual friend?

    To sum up, electronic photo, an e-card, or a gift voucher that can be announced and delivered by email, and can be used in his country are all nice ideas. The greatest pressure is not knowing what...

  • Does Blogger offer a Blogspot.com address forwarding service?

    It's possible to redirect your visitors, by modifying your blogger template and adding a bit of code to redirect traffic. You want to add something like this: <meta HTTP-EQUIV="REFR...

  • Is There A Website Where I Can Design A Virtual Car Online?

    No. In order to do 3D card design you will need some sort of CAD or 3D creation software.

    ...
  • How can i make one c++ program read the virtual memory of another?

    There are a few ways that shared data can happen. - create a RAM drive that has fast access. Then use both programs to open the same file. This is a GET IT DONE method. - my second sugge...

  • Somedoy has my ip address and stuff and was going to (vpn), What do I do now?

    Try Start > Control Panel > System > Remote > Uncheck everything to include the box in the Advanced tab Also in Control Panel > Administrative Tools > Services > Remote De...

  •  

    Categories--Copyright/IP Policy--Contact Webmaster