Reputation: 868
I want to redirect the url of sample.mysite.com
to
mysite.com/shops/index/sample.mysite.com
. How can i do this using
.htaccess
rules ?
Note : Here sample can be a variable ..
Upvotes: 0
Views: 19
Reputation: 41219
You can use the following rewriteRule
RewriteEngine on
RewriteCond %{HTTP_HOST} ^sample\.mysite\.com$
RewriteRule ^ /shops/index/sample.mysite.com%{REQUEST_URI} [L,R,NE]
This will internally forward sample.mysite.com to mysite.com/shops/index/sample.mysite.com with the requested uri.
Upvotes: 1