0

Sorry if this topic is not unique, but believe me, I've searched alot.

I've a website that users can subscribe and have a unique web page for themselves with address like this:

http://website.com/api/username

Now, I want to make them able to access their pages using addresses like this:

http://username.website.com

In fact, username comes here as a subdomain.

and I know I have to add a wildcard a record (* as name and website IP as address). I've made this changes.

But I couldn't find any .htaccess code working for my problem.

could you help me please? Thanks in advance.

Mohi Sanisel
  • 31
  • 1
  • 6
  • Assuming you have configured your DNS correctly, [this question](http://stackoverflow.com/questions/5407029/htaccess-subdomain-rewrite) seems to contain your answer. – Sumurai8 Jul 22 '14 at 09:06
  • redirect happen with this code: RewriteEngine On # Extract the subdomain part of domain.com RewriteCond %{HTTP_HOST} ^([^\.]+)\.2nate\.com$ [NC] # Check that the subdomain part is not www and ftp and mail RewriteCond %1 !^(www|ftp|mail)$ [NC] # Redirect all requests to the original url /blog RewriteRule ^.*$ http://2nate.com/beta1/api/%1 [L] – Mohi Sanisel Jul 23 '14 at 21:26

0 Answers0