Can you suggest a set of Apache rewrite rules to convert domain.com/app to app.domain.com? The rewrite rules should be valid for any app name and any sub path specified. For example, the script should be able to convert domain.com/otherapp/view.do to otherapp.domain.com/view.do in a generic fashion. Much appreciate.

没有正确的解决方案

其他提示

RewriteCond %{HTTP_HOST} domain\.com [NC]
RewriteRule ^/([A-Za-z0-9-]+)/(.*)$ http://$1.domain.com/$2 [L,R]
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top