具体的子域名指向一个路径和动态的子域名指向到其他路径 [英] Specific Subdomain point to a path and a dynamic subdomains point to another path

查看:119
本文介绍了具体的子域名指向一个路径和动态的子域名指向到其他路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个应用程序,我有一些具体的子域,请参阅:

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

  1. www.120mmsm.com是网站 - 确定
  2. signup.120mmsm.com是注册页面 - 错误
  3. login.120mmsm.com是登录页面 - 错误
  4. anything.120mmsm.com是倒在系统文件夹 - 确定

所以,该网站是响应在万维网。动态子域已经能够做到。但注册和登录陷入不能在不同的文件夹。给,你可以看到,当你进入上面的网址。

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.

我的htaccess code:

My htaccess code:

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

#Force https for everything that is not www
RewriteCond %{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?

推荐答案

你得到什么样的错误呢?你确定你的Apache的配置正确?

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

这篇关于具体的子域名指向一个路径和动态的子域名指向到其他路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆