Frage

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.

Keine korrekte Lösung

Andere Tipps

RewriteCond %{HTTP_HOST} domain\.com [NC]
RewriteRule ^/([A-Za-z0-9-]+)/(.*)$ http://$1.domain.com/$2 [L,R]
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top