Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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
.htaccess仅重定向不存在的页面,保留令牌_.htaccess - Fatal编程技术网

.htaccess仅重定向不存在的页面,保留令牌

.htaccess仅重定向不存在的页面,保留令牌,.htaccess,.htaccess,我想重定向 www.domain.com/abc 到 www.domain.com/index.php?a=abc 仅当文件夹abc不存在时。 如何写入.htaccess文件?试试看 RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^/(.*)$ http://www.domain.com/index.php?a=$1 [L] 它被重定向到i

我想重定向

www.domain.com/abc

www.domain.com/index.php?a=abc

仅当文件夹abc不存在时。 如何写入.htaccess文件?

试试看

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/(.*)$ http://www.domain.com/index.php?a=$1 [L]

它被重定向到index.php?a=/abc