服务器 Gind.cn
  • Linux
  • Windows
  • Ubuntu
  1. 服务器 Gind.cn
  2. .htaccess
  3. .htaccess RewriteRule将查询types的URL结构转换为目录types的URL
Intereting Posts
Gitolite gl-post-init钩子自动化 从同一磁盘启动两台服务器? CentOS的DNS不工作 – 无法parsing任何主机名 奇怪的行为与Docker伪装规则 Ruby MySQL / Gem的问题Windows 7 如何清除ehcache而无需重新启动服务器 设置一个反向代理caching图像 运行服务器的技巧 nginx和SNI:是否可以通过域名自动parsingSSL证书 svn和svn + ssh的颠覆path差异 是phpinfo(或类似)没有访问可能? Windows 2008服务器后台处理程序的问题 DNS服务器地址的组策略 重置ESXi root密码 当“免费”交换空间几乎用完时,在Ubuntu Web服务器上是什么意思?

.htaccess RewriteRule将查询types的URL结构转换为目录types的URL

我想转换下面的url:

/letters.php?q=test&d=789&t=2 

至:

 /test/789/2 

我试了下面的东西,但是没有成功:

 RewriteRule ^(.*)$ /letters.php?q=$1&d=$2&t=$3 [R=301,L] 

  • 阅读.htaccess和Tomcat
  • 获取gzip压缩在我的服务器上工作(模块?)
  • Htaccess文件根据请求的域redirect到某个网页
  • 转换.htaccess到nginx是打破我的应用程序
  • 运行.html为.php

  • .HTACCESS – 删除部分url
  • 使用mod_rewrite的相当URL的冲突
  • htaccessredirect参数
  • Ubuntu 12.10 .htaccess仍然无法正常工作
  • 重写规则(删除.php)和旧的redirect301不工作?

你需要分解RewriteRule提取uri的每个部分,即testing,789和2; 喜欢这个:

 RewriteRule ^([^/]+)/([^/]+)/([^/]+)$ /letters.php?q=$1&d=$2&t=$3 [NC] 

有一个很好的文章.htaccess提示和技巧 ,显示重写规则如何工作。

  • 使用htaccess文件将https地址redirect到相应的http地址
  • 我如何使用Apache RewriteRules + PHP来确定要显示哪个页面?
  • 将.htaccess http授权转换为nginx
  • WordPress的子目录apache2没有浏览索引和.htaccess
  • .Htaccess – 文件扩展名不会被删除
  • RedirectMatch:我如何避免保留查询string
  • 尝试使用htaccess从site1.comredirect到site2.com,而无需更改地址栏中的url
  • 自动预置可执行Perl脚本使用.htaccess(如php_value auto_prepend_file)?
  • 将每个请求redirect到索引页面
  • 了解mod_rewrite语法

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