您好,我似乎遇到了一些mod_rewrite的问题。
.htaccess正在/欢迎来自/welcome.php;
重写网址但他们正在返回404错误。
的Apache2 PHP 7.1 MySQL 5.8 mod_rewrite已启用并加载
有人可以帮助我完全失去了吗?
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#For removing extension as Options +MultiViews not working with RewriteRule
RewriteRule ^([a-zA-Z0-9_]+)$ $1.php [QSA,NC,L]
RewriteRule ^profile/([a-zA-Z0-9._@\-]+)$ profile.php?u=$1 [QSA,NC,L]
RewriteRule ^profile/ profile.php [QSA,NC,L]
RewriteRule ^groups/([0-9]+)$ groups.php?grp=$1 [QSA,NC,L]
RewriteRule ^groups/ groups.php [QSA,NC,L]
RewriteRule ^view_post/([a-zA-Z0-9]+)$ view_post.php?post=$1 [QSA,NC,L]
ErrorDocument 404 /404.php
#DirectoryIndex Options +Indexes
<FilesMatch ".(htaccess)">
order allow,deny
deny from all
</FilesMatch>
#Options +MultiViews
IndexIgnore *
</IfModule>
这是我的.htaccess文件。