开发者

Help me with the Clean URL problem

开发者 https://www.devze.com 2022-12-14 03:44 出处:网络
I have an .htaccess file set up like so: RewriteEngine on RewriteRule ^home//member.php [L] So when users type http://domai开发者_如何学Cnname.com/home/ it goes to the member page,

I have an .htaccess file set up like so:

RewriteEngine on
RewriteRule ^home/    /member.php [L]

So when users type http://domai开发者_如何学Cnname.com/home/ it goes to the member page, but when they type http://domainname.com/home I get a 404 error.

What am I doing wrong?


Because your rule only applies if a / is added after the home part.

Off the top of my head, this should do it:

RewriteEngine on 
RewriteRule ^home(/)? /member.php [L]
0

精彩评论

暂无评论...
验证码 换一张
取 消