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

mod_rewrite规则,用于托管在目录中的站点

I have a site that i am building in a directory, not in the root of my webserver.

I would like  http://localhost/mysite/index.php?view=home

to rewrite to http://localhost/mysite/home

I can't get it to work

trying this in .htaccess

RewriteEngine On
RewriteBase /mysite/
RewriteRule ^([^/]*)$ index.php?view=$1 [L]

I GOT IT!

RewriteEngine On
RewriteRule ^([A-Za-z0-9-]+)/?$ index.php?view=$1 [L]

many thanks to http://www.cheatography.com/davechild/cheat-sheets/mod-rewrite/

近期文章

  • 如何在symfony2中使用控制器扩展Listener?
  • 当数据通过ios时,json_decode返回null
  • Codeigniter如何使Facebook登录持续存在?
  • OSX本地环境中的Symfony2权限问题
  • 迭代数据库中的行并删除它们
  • 如何从n开始选择mySQL中的每一行
  • 使用PHP将数据从类插入数据库
  • 是否有可能加载PHP并运行Javascript?
  • 使用ENGINE子句在迁移中创建表失败
  • 将创建新的php.ini将覆盖原始文件
  • Instagram API:如何在热门Feed中查看用户
  • SplObjectStorage不能与String一起使用,该怎么办?
  • 生成唯一盐(给出未经验证的示例)
  • ASP.net和PHP的成本,要求和差异[关闭]
  • AJAX调用成功,但未在服务器上检索数据
  • 融合图表中的一个网页中的多个图表
  • mysql如何比较同一个表中的两行?
  • 带有WAMP和URL重写的CodeIgniter上的404错误
  • Wordpress - 删除动态生成的样式表?
  • 面对警告LDAP使用PHP错误的链接资源

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华