URL重写/ MOD重写的.htaccess在Apache和PHP

问题描述:

我有一个入口点在我的网站

I have a single point of entry on my website

mysite.com/admin/index.php 查看=列表与放大器;型号=用户

到数据库/应用的所有访问都是通过这个index.php文件。

All access to the DB/application is through this index.php file.

我想从清洁是什么上面显示我的网址。

I would like to clean my URL from what is shown above to.

mysite.com/admin/ 列表/用户

我们的想法是删除键模式和查看。

The idea is to remove the key 'Model and 'View'.

我发现这个链接看起来非常相似。

I have found this link that looks very similar.

PHP /阿帕奇:重写与的.htaccess 规则

在htaccess文件插入此code:

in htaccess file insert this code :

RewriteEngine On
RewriteRule ^admin/([^/]*)/([^/]*)$ /admin/index.php?View=$1&Model=$2 [L]

重写网址:

http://mysite.com/admin/List/User

本网站产生重写URL非常有用的。

this site very useful for generate rewrite URL

http://www.generateit.net/mod-rewrite/