.htaccess 网站首页/网站首页/网站首页/登录

shstlldc  于 2022-11-16  发布在  其他
关注(0)|答案(1)|浏览(142)

我要将localhost/website/index.php?pages=pages/login.php重写为localhost/website/login
这是我的尝试,当我打开localhost/website/login它说404没有找到

RewriteEngine On
RewriteBase /Domain/

#Make sure it's an actual file
RewriteCond %{REQUEST_FILENAME} -f [OR]
#Make sure its a directory
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule ^ - [L]

#Rewrite the request to index.php
RewriteRule ^([^/]+)/?$ index.php?pages=pages/$1 [NC,L,QSA]
moiiocjp

moiiocjp1#

<IfModule mod_rewrite.c>
  Options -Multiviews
  RewriteEngine On
  RewriteBase /website/login
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule  ^(.+)$ index.php?pages=pages/login.php [QSA,L]
</IfModule>

你好,我不知道你到底想做什么,但试试这个

相关问题