服务器 Gind.cn
  • Linux
  • Windows
  • Ubuntu
  1. 服务器 Gind.cn
  2. .htaccess apache 2.2 mod rewrite
  3. mod_rewrite捕获子域名
Intereting Posts
在Ubuntu Trusty上保护Monit 5.6 httpd 访问嵌套虚拟机中的docker容器 Windows“Everything”安全标识符包含了什么(例如它是否包含像DOMAIN \ MACHINE $这样的计算机帐户)? apache localhost服务于index.html,但不提供.php文件 如何与Ubuntu虚拟机共享Internet连接? CentOS 5.5不能启动了, 可怕的“无法find文件系统/ dev / root”错误 为什么我的程序在VPS上运行速度慢了2-4倍? 过多的时间到第一个字节 通过VirtualBox访问MySQL服务器 ldap查询活动目录:所有用户分配了其组或成员的用户 如果后端不可用,nginx代理将不会重试 SHUTDOWN / S / M \\ RemoteMachine和Windows更新? 为什么Buildroot的通用pc_x86_64_bios_defconfig图像挂在Virtualbox? 是否有必要监视proccesses的PID? 文件反复下载forms相同的IP – build议?

mod_rewrite捕获子域名

我想写一个重写scheme,以便:

  • user1.example.net将redirect到example.net/user/user1
  • user2.example.net将redirect到example.net/user/user2

这是我在我的.htaccess代码。 但它总是redirect到example.net 。

 RewriteCond %{http_host} ^[^.]+\.example\.net [NC] RewriteRule ^([^.]+)\.example\.net(.*) http://example.net/user/$1 [R=301,L] 

有人能告诉我我做错了什么吗?

  • htaccess – redirect超过1级深度不工作
  • CNAMEredirect到WordPress的博客不工作
  • .HTACCESS子域,而不是.CONF子域
  • .htaccess文件放置
  • 需要禁用vHost或.htaccess中的子子域

  • htaccess – 从domain.com/index.phpredirect到domain.com?
  • .htaccess身份validation内部服务器错误500
  • 似乎无法得到mod_rewrite设置环境variables
  • 使用.htaccess将用户从httpsredirect到http时遇到问题
  • 如何拒绝用户从特定目录读取* .jpg
 RewriteEngine on RewriteCond %{HTTP_HOST} ^(.*)\.example.com [NC] RewriteRule ^(.*)$ http://example.com/user/%1/$1 [R=301,L] 
  • DNS通配符和虚拟子域
  • 安全301redirect使用htaccess的两个域名
  • 如何将子文件夹的子域redirect到使用相同子文件夹和子域本身作为参数的域?
  • 非ruby网站上的Ruby错误
  • 将example.com/*redirect到www.example.com/*
  • 创build301redirect不希望工作
  • 破坏.htaccess
  • .htaccess – 如何告诉wordpress忽略一个目录
  • Mod Rewrite – 检查特定目录中的文件
  • htaccess – 如何在服务器和本地机器上处理不同的目录名称?

  • © 2017 服务器 Gind.cn
  • Topics
  •        
  • Powered by Server
  • Privacy Policy