服务器 Gind.cn
  • Linux
  • Windows
  • Ubuntu
  1. 服务器 Gind.cn
  2. .htaccess apache 2.2 mod rewrite
  3. mod_rewrite捕获子域名
Intereting Posts
找不到Drupal中所有节点的文件 无法访问NAS设备 在zsh中清空一个文件 如何获得cURL错误进入正确的日志文件? 如何为无法访问企业内部网的移动设备提供安全的网页内容? 如何设置运行在pfSense上的OpenVPN的WINS服务器? 傀儡仪表板升级失败 有线/以太网纯ipv6路由器? QMail不传递到我自己的域的远程邮箱 QSFP28和SFP +端口的兼容性 Outlook设置错误的“date”标题 我需要为本地侦察小组提供桌面解决scheme的build议 需要的build议:SQL Server 2008 Express的热备份解决scheme? Exchange 2010,事件3145 MSEXCHANGEREPL错误 后缀:dynamic重写服务器名称取决于发件人域

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