how to redirect any subdomain to main domain using .htaccess — CyberPanel - WebHosting Control Panel for OpenLiteSpeed
CyberLoader

how to redirect any subdomain to main domain using .htaccess

edited September 2019 in Web Server
hello,
im new with cyberpanel, im using this for wordpress, i want redirect any sub-domain to main domain with .htaccess, i was try edit rewrite rules and add this code below LSCACHE and before wordpress rules

RewriteCond %{HTTP_HOST} ^(.+)\.mydomain\.com$ [NC]
RewriteRule ^ http://mydomain.com/ [L,R]

but not working, have any solution?

Comments

Sign In or Register to comment.
CyberPanel Discord

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!