.htaccess htaccess添加301已永久移动到重写规则
我的.htaccess文件中有此规则:.htaccess htaccess添加301已永久移动到重写规则,.htaccess,mod-rewrite,http-status-code-301,.htaccess,Mod Rewrite,Http Status Code 301,我的.htaccess文件中有此规则: Options +FollowSymLinks RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule . /index.php 它所做的是将所有url的index.php?somevar=#重定向到index.php,但是当它重定向时,它发出代码302,我希望它是301 我试图在重写规则之后添加[R=301]
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . /index.php
它所做的是将所有url的index.php?somevar=#重定向到index.php,但是当它重定向时,它发出代码302,我希望它是301
我试图在重写规则之后添加[R=301]
/php但它不起作用
感谢您的帮助:-)这件事与您描述的不符。您的规则将每个请求发送到不存在的文件,发送到
index.php
。网址:
index.php?anything
已经调用了index.php
。你不需要任何重写魔法来处理这个问题
还有
RewriteRule .* /index.php