Jump to content

subdomain redirection


Frank Vèssia
 Share

Recommended Posts

Hi guys, I need to create fake subdomains for my users, right now my htaccess code is this one:

RewriteCond %{HTTP_HOST} !^(www\.|cdn\.)?domain\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(\w+)\.domain\.com$ [NC]
RewriteRule ^ user/%1%{REQUEST_URI}

and it works pretty good except for one thing:

this works => http://username.domain.com/subfolder

this doesn't => http://username.domain.com/subfolder/

the trailing slash causes some issue...any idea? 
 

(I had to remove the trailing slash option from the template of "subfolder" page otherwise i get errors in both cases)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...