Click here to Skip to main content
15,868,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can someone please help me with this htaccess, I just want http://subdomain.example.com/login -> http://www.example.com/login

What I have tried:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(.+).example.com\login [NC]
RewriteCond %{HTTP_HOST} !^www.example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/login/$1 [L,NC,QSA]
Posted
Comments
Richard Deeming 16-Nov-18 13:42pm    
If you want users to log in to your site, then you should be serving it over HTTPS, not HTTP.

If you serve it over HTTP, then all browsers will display a "NOT SECURE" warning for your site, and warn your users when they start to type in their credentials.
Member 14051386 17-Nov-18 6:00am    
Thank you for reminding about this, but can you please help me fix my htaccess code?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900