URL重写/ MOD重写的.htaccess在Apache和PHP [英] URL Rewrite/Mod Rewrite .htaccess on Apache and PHP
本文介绍了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.
推荐答案
在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/
这篇关于URL重写/ MOD重写的.htaccess在Apache和PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文