RewriteCond IT work
- or -
Post a project like this2148
£20(approx. $25)
- Posted:
- Proposals: 1
- Remote
- #1996253
- Awarded
Description
Experience Level: Intermediate
Estimated project duration: 1 day or less
Experience Level: Intermediate
Estimated Job duration: 1 day or less
I've got a working solution to having both Non-WWW and HTTP redirect to https://www.example.com, however I need to ensure that ONLY this domain with subdomain is affected.
I currently have https://app.example.com live for the logged in version of my website, and this means that any access to https://app.example.com is redirected to https://www.app.example.com
This can't happen. How do I write a RewriteCond that checks if the host name is not this specific one? The only ones to be checked are http://example.com, https://example.com and https://www.example.com
Here's my htaccess:
RewriteCond %{THE_REQUEST} \.html
RewriteRule ^(.*)\.html$ /$1/ [R=301,L]
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Estimated Job duration: 1 day or less
I've got a working solution to having both Non-WWW and HTTP redirect to https://www.example.com, however I need to ensure that ONLY this domain with subdomain is affected.
I currently have https://app.example.com live for the logged in version of my website, and this means that any access to https://app.example.com is redirected to https://www.app.example.com
This can't happen. How do I write a RewriteCond that checks if the host name is not this specific one? The only ones to be checked are http://example.com, https://example.com and https://www.example.com
Here's my htaccess:
RewriteCond %{THE_REQUEST} \.html
RewriteRule ^(.*)\.html$ /$1/ [R=301,L]
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Jason L.
100% (11)Projects Completed
8
Freelancers worked with
9
Projects awarded
67%
Last project
2 May 2018
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies