我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

帮我解决Clean URL问题

I have an .htaccess file set up like so:

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

So when users type http://domainname.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]

近期文章

  • 插件问题 - Zend Framework
  • PHP Mashup中的问题
  • 我的管理员面板并上传
  • 这个facebook登录代码有什么问题?
  • php简单的xml元素问题/ bug
  • 如何在页面上嵌入模块?
  • 域名可用性检查程序
  • PHP $ _FILES文件循环上传
  • name =“option11”,name =“option21”,name =“option31”,name =“option41”,1,2,3,4 ..,是一个变量。 怎么写代码?
  • 图片上传 - 拉丁字符问题
  • IIS 7和FastCGI问题
  • 在网站中创建,删除和使用电子邮件帐户! 可能吗?
  • 故障安全循环通过网址数组
  • 使用PHP和MYSQL插入行组
  • PHP:MVC框架的特征
  • 如何在Zend Framework 1.8+中测试我的表单?
  • JS cookie变量在帖子后丢失了
  • PHP / SQL循环项每隔x分钟
  • 操纵电子邮件的内容
  • (PHP)验证,安全性和速度 - 我的应用程序是否有这些?

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华