我有一个入口点在我的网站URL重写/现代重写的.htaccess在Apache和PHP
mysite.com/admin/index.php?View=List&Model=User
到数据库/应用的所有访问都是通过这个index.php文件。
我想从上面显示的内容中清除我的URL。
mysite.com/admin/List/User
的想法是删除键“模式和‘查看’。
我发现这个链接看起来非常相似。
PHP/Apache: Rewrite rules with .htaccess
我有一个入口点在我的网站URL重写/现代重写的.htaccess在Apache和PHP
mysite.com/admin/index.php?View=List&Model=User
到数据库/应用的所有访问都是通过这个index.php文件。
我想从上面显示的内容中清除我的URL。
mysite.com/admin/List/User
的想法是删除键“模式和‘查看’。
我发现这个链接看起来非常相似。
PHP/Apache: Rewrite rules with .htaccess
插入此代码:
RewriteEngine On
RewriteRule ^admin/([^/]*)/([^/]*)$ /admin/index.php?View=$1&Model=$2 [L]
的重写URL:
http://mysite.com/admin/List/User
这个网站产生重写URL非常有用
我保存该链接! – IEnumerable 2012-02-06 12:41:00
中创建一个Web根名为.htaccess文件,如果你还没有已经有了一个具有以下内容:
# Turn the rewrite engine on (skip this if already done)
RewriteEngine On
# Redirect admin/List/User/ to admin/index.php?View=List&Model=User
RewriteRule ^admin/([^/.]+)/([^/.]+)/?$ admin/index.php?View=$1&Model=$2 [L]
这可能会实现:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^admin/([^/]+)/([^/]+) /index.php?View=$1&Model=$2 [NC]
添加到您网站的根文件夹中的.htaccess。
无的选择似乎上班。我有一种感觉我缺少一个模块 – IEnumerable 2012-02-06 12:38:24
LoadModule rewrite_module modules/mod_rewrite.so已启用,是否还有其他模块需要启用? – IEnumerable 2012-02-06 12:40:24