所以目前我的网址看起来像是
myurl.com/folder/m=forums/forums.ws/83,128,1273173814/index.php?id=4
我试图让它看起来像
myurl.com/folder/m=forums/forums.ws/83,128,1273173814/1
我已经设置了一个url重写,但是当我到达它时说dir不在那里
myurl.com/folder/m=forums/forums.ws/83,128,1273173814/1
RewriteEngine On
rewritecond %{HTTP_HOST} ^http://myurl.com/folder/m=forums/forums.ws/83,128,1273173814/$ [OR]
rewritecond %{HTTP_HOST} ^myurl.com/folder/m=forums/forums.ws/83,128,1273173814/$
RewriteRule ^/?([-A-Za-z0-9]+)/?$ index.php?id=$1 [L]
答案 0 :(得分:0)
您的规则是错误的,因为%{HTTP_HOST}
仅匹配请求中的域名而不匹配请求URI。
您可以在根目录中使用此规则.htaccess:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^myurl\.com$
RewriteRule ^(folder/m=forums/forums.ws/83,128,1273173814)/([0-9]+)/?$ /$1/index.php?id=$2 [L,QSA]
答案 1 :(得分:0)
尝试将其放入myurl.com/folder/m=forums/forums.ws/83,128,1273173814 /
RewriteEngine on
RewriteBase /folder/m=forums/forums.ws/83,128,1273173814/
RewriteRule ([^/]+)/([^/]+)\ index.php?id=$1 [L]