服务器 Gind.cn
  • Linux
  • Windows
  • Ubuntu
  1. 服务器 Gind.cn
  2. .htaccess apache 2.2 mod rewrite
  3. mod_rewrite捕获子域名
Intereting Posts
使用Plesk 9.5将Ubuntu Server 8.04中的PHP升级到5.3 试图添加ssh-key时如何解决“无法打开连接到你的authentication代理”错误? Ubuntu Upstart作业 – “停止”是不能识别的命令 ruby:无效的操作码 在执行下一行之前,等待几秒钟 如何知道RAID 1已安装? PFSense没有获得广域网IP,但以太网适配器有一个(Hyper-V) 有什么方法可以知道user_beancounters中的资源何时遇到障碍 定制构build服务器与品牌服务器 事件ID 4104 SmallBusinessServer spamassassin –lint和spamc返回不同的分数 HP ML150 G6升级RAM / CPU超出规格? 将Windows共享迁移到基于Samba Linux的共享 升级HP DL185 G5 8LFF,是否可以使用Dell J1520 4-Drop SATA适配器? 编写一个基于apache版本的apacheconfiguration

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