[英]Php header url redirect and htacces
我对htaccess中的Apache RewriteRule感到困惑。 我有数百个header('Location: script_name.php');
在我的webapp中,并且希望使url更加用户友好(不支持SEO,因为不允许搜索引擎抓取该应用)。 这是一段典型的代码:
if(isset($_POST['get_product']))
{
// PHP/PDO code here
header('Location: product_catalog_detail.php?with or without query strings');
}
给出:
http://localhost/smart_entreprise/folder1/folder2/product_catalog_detail?catID=1&productID=1
现在,我想将此URL保留在服务器端,并向用户显示所有以product_catalog
开头的脚本名称:
http://localhost/smart_entreprise/folder1/folder2/catalog
甚至更好:
http://localhost/smart_entreprise/catalog
这样做有意义吗? 谢谢。
#/webroot/.htaccess
RewriteRule ^smart_entreprise\/(\w+)$ product_catalog_detail.php?catID=$1
请参见
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.