Subdomains and htaccess

  • DavyDuke17
  • Graduate
  • Graduate
  • DavyDuke17
  • Posts: 166

Post 3+ Months Ago

I believe I can achieve the following with htaccess but am not positive, so I was hoping someone could let me know and maybe help me out.

What I want to do is if someone accesses the following page on my website they are actually viewing the file . If this is possible I'd also like to have refer to

  • cipher
  • Graduate
  • Graduate
  • User avatar
  • Posts: 157

Post 3+ Months Ago

I am not sure how you would do this with htaccess since I don't have Apache, but what you can do is have a wildcard CNAME in your DNS record such as *

Then you can extract subdomains using something like

Code: [ Select ]
list($subdomain) = explode('.', $_SERVER['HTTP_HOST'], 2) -> www -> your-site> test

This is only one solution. The pitfall here is that you have to eliminate www and your-site. Experimenting would reveal other ways.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 61 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum

© 1998-2017. Ozzu® is a registered trademark of Unmelted, LLC.