Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何写htaccess_Php_Jquery - Fatal编程技术网

Php 如何写htaccess

Php 如何写htaccess,php,jquery,Php,Jquery,我想要一个htaccess,可以将其更改为 它还应该保持查询的完整性,以便我可以在页面中使用它使用它并享受: RewriteEngine On RewriteBase / # Redirect /index?id=2 to /index/2 RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+index\?id=([^&\s]+) [NC] RewriteRule ^ /index?%1 [R=302,L] RewriteCond %{REQUEST_F

我想要一个htaccess,可以将其更改为

它还应该保持查询的完整性,以便我可以在页面中使用它

使用它并享受:

RewriteEngine On
RewriteBase /

# Redirect /index?id=2 to /index/2
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+index\?id=([^&\s]+) [NC]
RewriteRule ^ /index?%1 [R=302,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [QSA,L]

在我看来,您似乎想要隐藏参数。你不应该考虑发布你的参数而不是使用GET吗?这不是OP要求的。似乎他想隐藏所有参数,而不仅仅是将它们更改为看起来像子文件夹的结构。。。