【问题标题】:How can I use sub directory php file request values in htaccess如何在 htaccess 中使用子目录 php 文件请求值
【发布时间】:2013-03-01 21:01:44
【问题描述】:

我的路径类似于 www.example.com/coupon/searchresult.php?txtCity=Chennai&txtArea=Annanagar。对于上述子文件夹的路径文件,htaccess 不起作用。这是我第一次使用 htaccess。所以请提供你的答案。提前谢谢.....

【问题讨论】:

  • 请显示您当前的 .htaccess 文件。
  • 你当前htacces的代码是什么?

标签: php .htaccess


【解决方案1】:
RewriteRule ^([a-zA-Z0-9_-]+)/coupon/([a-zA-Z0-9_-]+)/$  searchresult.php?txtcity=$1&txtarea=$2

RewriteRule ^([a-zA-Z0-9_-]+)/coupon/$  searchresult.php?txtcity=$1&txtarea=$2

请使用这个并根据您的需要进行修改,它会帮助您确定!

【讨论】:

  • 上面的代码也不能在htaccess中工作。我用像“RewriteRule ^([a-zA-Z0-9_-]+)/coupon/$ searchresult.php?txtcity=$1&txtarea=$2 [QSA,L]”。有没有其他解决方案可以解决这个问题?
猜你喜欢
  • 2011-09-11
  • 2011-08-08
  • 2011-10-14
  • 1970-01-01
  • 2012-06-22
  • 2014-05-18
  • 2013-07-08
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多