【问题标题】:some issue on rewriting url using htaccess [duplicate]使用 htaccess 重写 url 的一些问题 [重复]
【发布时间】:2014-10-24 20:58:00
【问题描述】:

当用户访问“https://www.example.com/api3/SGy7bT”网址时,我想加载“https://www.example.com/api3/webhook3_index2.php?random=SGy7bT”页面。在浏览器上,url 不会改变,它会看起来像上面提到的 url。

我的 htaccess 文件存在于“/api3”文件夹中。

【问题讨论】:

标签: .htaccess url-rewriting


【解决方案1】:

试试:

RewriteEngine On
RewriteBase /api3/

RewriteCond %{THE_REQUEST} /api3/webhook3_index2\.php\?random=([^&\ ]+)
RewriteRule ^ %1? [L,R]

RewriteCond %{REQUEST_FILEAME} !-f
RewriteCond %{REQUEST_FILEAME} !-d
RewriteRule ^(.*)$ webhook3_index2.php?random=$1 [L,QSA]

【讨论】:

  • 感谢您回答我的问题。访问该网址时工作正常,但我们在“/api3”文件夹下还有其他页面,当访问“/api3”文件夹下的其他页面时,总是得到“404 not found”。请帮帮我。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-12-19
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多