开发者

Specific Subdomain point to a path and a dynamic subdomains point to another path

I am developing an application where I have some specific subdomains, see:

  1. www.120mmsm.com is the site - OK
  2. signup.120mmsm.com is the registration page - ERROR
  3. login.120mmsm.com is the login page - ERROR
  4. anything.120mmsm.com is to fall in the system folder - OK

So the site is responding at www. The dynamic subdomain has managed to do. But the signup and login to fall into different folders can not. Give and you can see when you enter the urls above.

My htaccess code:

#does nothing if www
RewriteRule ^www/ - [L] 

#Force https for everything that is not www
Rewri开发者_JAVA百科teCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !(www)\. [NC]
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

#signup
RewriteCond %{HTTP_HOST} ^(signup)\. [NC]
RewriteRule ^(.*)?$ signup/$1 [L]

#login
RewriteCond %{HTTP_HOST} ^(login)\. [NC]
RewriteRule ^(.*)?$ login/$1 [L]

#system
RewriteCond %{REQUEST_URI} !^/sistema/
RewriteCond %{HTTP_HOST} !www.120mmsm.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www|singup|login)?([a-z0-9-]+).120mmsm.com [NC]
RewriteRule ^(.*)?$ sistema/$1

Where am I wrong?


What type of error did you get? Are you sure you have the right configuration of Apache?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜