我需要重新格式化具有结构的URL
http://www.example.com/vaservice/ServiceController.svc?v1=d1&v2=d2& ...
至
http://www.example.com/vaservice/ServiceController/svc?v1=d1&v2=d2& ...
我用这个htaccess代码从url中删除了.svc,但我无法弄清楚如何替换。 使用/而不是仅删除扩展名。
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.svc [NC] RewriteRule ^ %1 [R,L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.svc -f RewriteRule ^(.*?)/?$ $1.svc [L]I need to reformat a url with the structure
http://www.example.com/vaservice/ServiceController.svc?v1=d1&v2=d2&...
to
http://www.example.com/vaservice/ServiceController/svc?v1=d1&v2=d2&...
I have removed the .svc from the url with this htaccess code but I cannot figure out how to replace the . with a / instead of just removing the extension.
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.svc [NC] RewriteRule ^ %1 [R,L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.svc -f RewriteRule ^(.*?)/?$ $1.svc [L]最满意答案
想出来谢谢!
RewriteCond %{THE_REQUEST} ^[AZ]{3,}\s([^.]+)\.svc [NC] RewriteRule ^ %1/svc [R,L]
Figured it out thanks!
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.svc [NC] RewriteRule ^ %1/svc [R,L]
更多推荐
发布评论