Jump to content

NeoVidaMedia

New Members
  • Posts

    2
  • Joined

  • Last visited

NeoVidaMedia's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I've tried so many things! I am getting a massive headache. Just in case someone tried to help, here is some specific information: On my hosting account I have the following domains: realbanknotes.com mcatzone.com digitalproteus.com I also have the following subdomains: blog.realbanknotes.com micro.digitalproteus.com Also, I have the following directory: realbanknotes.com/forums/ Here is what I have been trying to do: RewriteCond %{HTTP_HOST} ^(realbanknotes\.com)$ [NC] RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] As I understand it, this rule should only work for the domain 'realbanknotes.com.'. It should not work for digitalproteus.com or mcatzone.com, but it does. Also, I would like to exclude the following from this rule: all domains other than realbanknotes.com (in this case exclude digitalproteus.com and mcatzone.com) subdomain: blog.realbanknotes.com directory: realbanknotes.com/forums/ The second rule is this: RewriteCond %{HTTP_HOST} ^(www\.realbanknotes\.com)$ [NC] RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] As I understand it, this second rule should only work for the domain 'realbanknotes.com' as well. It should not work for digitalproteus.com or mcatzone.com, but it does. Also, I would like to exclude the following from this rule: all domains other than realbanknotes.com (in this case exclude digitalproteus.com and mcatzone.com) subdomain: blog.realbanknotes.com directory: realbanknotes.com/forums/
  2. I recently installed a SSL certificate for one of my domains, on a hosting account that includes several other domains. To redirect visitors to the SSL version of the website (because the SSL certificate only works for the www. version of the site) I use the following code in my .htaccess file: #First rewrite any request to the wrong domain to use the correct one (here www.) RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] #Now, rewrite to HTTPS: RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] This works fantastically for the domain in question, but unfortunately it also happens for all other domains, none of which have SSL certificates, giving all visitors an error at the moment. I am not very familiar with .htaccess functions, abilities, and code. I am looking for something like this: if (domain name includes 'domain1.com') { if (domain name also includes '/forums/' or '/blog/') {do nothing} else }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.