为gamesdb.net重写apache url

为gamesdb.net重写apache url,apache,url-rewriting,Apache,Url Rewriting,我在知识上遇到了一点差距 我正在尝试在我为之开发的网站上启用友好(或友好er)URL: 要更深入地了解当前的URL格式,请查看我刚才提供的站点链接。但要快速浏览,这里有几个示例URL: 有人知道配置htaccess文件以更友好的方式重写这些文件的合适代码吗?我自己也尝试过,但它一直让我心烦意乱,不起作用。。。已安装apache mod_rewrite 老实说,我很乐意接受隐藏“index.php”并重新编写“tab”参数,至少这会给我一点代码作为开始 提前感谢, 亚历克斯:)这是你可以使用

我在知识上遇到了一点差距

我正在尝试在我为之开发的网站上启用友好(或友好er)URL:

要更深入地了解当前的URL格式,请查看我刚才提供的站点链接。但要快速浏览,这里有几个示例URL:

有人知道配置htaccess文件以更友好的方式重写这些文件的合适代码吗?我自己也尝试过,但它一直让我心烦意乱,不起作用。。。已安装apache mod_rewrite

老实说,我很乐意接受隐藏“index.php”并重新编写“tab”参数,至少这会给我一点代码作为开始

提前感谢,


亚历克斯:)

这是你可以使用/做的一个框架:

RewriteEngine On
RewriteBase /

# http://thegamesdb.net/?tab=game&id=90&lid=1 => http://thegamesdb.net/tab/games/90/1
RewriteRule ^tab/games/([0-9]+)/([0-9]+)(/?)$ index.php?tab=game&id=$1&lid=$2 [NC,QSA,L]

# http://thegamesdb.net/?tab=adminstats&statstype=topratedgames => http://thegamesdb.net/admin/stats/top-rated-games
RewriteRule ^admin/stats/([a-z0-9\-]+)(/?)$ index.php?tab=adminstats&statstype=$1 [NC,QSA,L]

# http://thegamesdb.net/index.php?string=Sonic+the+Hedgehog&searchseriesid=&tab=listseries&function=Search => http://thegamesdb.net/list-series/search/Sonic+the+Hedgehog/
RewriteRule ^([a-z0-9\-\.\+\ ]+)/search/([a-z0-9\-\.\ \+]+)(/?)$ index.php?tab=$1&string=$2&searchseriesid=&function=search [NC,QSA,L]

# http://thegamesdb.net/index.php?string=Sonic+the+Hedgehog&searchseriesid=&tab=listseries&function=Search => http://thegamesdb.net/list-series/search/Sonic+the+Hedgehog/12
RewriteRule ^([a-z0-9\-\.\+\ ]+)/search/([a-z0-9\-\.\ \+]+)/([0-9]+)(/?)$ index.php?tab=$1&string=$2&searchseriesid=$3&function=search [NC,QSA,L]

这些是您需要重写的唯一URL?或多或少,如果还有,希望我能自己从示例中解决修改。。。我只是刚开始有点为难。第一次尝试这样的东西:(嘿,非常感谢!我会尝试一下,看看我的进展如何。为加入在线评论而干杯……它们将帮助我构建规则以供进一步使用。再次,非常感谢你,非常感谢你的帮助:)