需要有关htaccess的帮助

时间:2014-04-26 04:35:24

标签: php .htaccess

我想转换此网址:

http://something.com/FLSD/DSS/?d=624

进入这个:

http://something.com/FLSD/DSS/624/

我该怎么做?

2 个答案:

答案 0 :(得分:1)

将此添加到.htaccess文件中:

RewriteEngine On
RewriteBase /

RewriteRule ^FLSD/DSS/([0-9]+)/?$ /FLSD/DSS/?d=$1

答案 1 :(得分:0)

这应该有效:

RewriteEngine on
RewriteCond %{THE_REQUEST} ^(GET|POST)\ /FLSD/DSS/\?d=([0-9]+)\ HTTP
RewriteRule ^ /FLSD/DSS/%2\? [R=301,L]

RewriteRule ^FLSD/DSS/([0-9]+)/?$ /FLSD/DSS/?d=$1 [L]

它会将http://something.com/FLSD/DSS/?d=624转换为http://something.com/FLSD/DSS/624/