Home Redirecting subdomain without changing URL using .htaccess
Reply: 0

Redirecting subdomain without changing URL using .htaccess

user577 Published in March 21, 2018, 8:18 pm

wondering if you can help me with some .htaccess.

I want to have sub.example.com display data from example.com/sub without changing the URL : ie. sub.example.com will stay sub.example.com although it is reading from example.com/sub

I have the following data in .htaccess:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^sub.example.com
RewriteRule ^(.*)$  http://example.com/sub/$1 [L,NC,QSA]

I tried to change the [L,NC,QSA] to [P] but I get an error 403 - forbidden access.

Any help would be appreciated!

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.294146 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO