I find it very difficult to edit the .htaccess file to do these three things together. I was able to get each part separately, but I just donβt understand how the logical thread works to make them work.
This is the best I managed to put together with a demo with the support of bluehost http://helpdesk.bluehost.com/index.php/kb/article/000347
I appreciate any help in solving this problem.
# Use PHP5 Single php.ini as default AddHandler application/x-httpd-php5s .php
Update:
Well, after a long time, using the following, I ran into problems.
IndexIgnore * RewriteEngine On RewriteCond %{HTTP_HOST} ^example\.com$ [OR] RewriteCond %{SERVER_PORT} 80 RewriteCond %{REQUEST_URI} !^/site/ RewriteRule (.*) https://www.example.com/site/$1 [L,R] RewriteCond %{HTTP_HOST} ^example\.com$ [OR] RewriteCond %{SERVER_PORT} 80 RewriteCond %{REQUEST_URI} ^/site/ RewriteRule (.*) https://www.example.com/$1 [L,R] RewriteCond %{HTTP_HOST} ^example\.com$ [OR] RewriteCond %{SERVER_PORT} 443 RewriteCond %{REQUEST_URI} !^/site/ RewriteRule (.*) https://www.example.com/site/$1 [L,R]
New problems.
Bluehost has an app that quickly installs and updates open source apps like wordpress, joomla, phpbb, etc. Apparently, my new super.htaccess file completely destroys their system. The only way I can run updates and installations is to move .htaccess to .htaccess.bak before the update or installation is complete. Then move it back.
I cannot create any .htaccess on other sites that I host in other directories. for example I have a main account that I store in / www / site / that this script requests requests. Unfortunately, my other sites stored in / www / site2 / and / www / site3 / do not work well. First I need to create an empty .htaccess so that it cannot pull the .htaccess above found in / www /. For some reason, if I try to do something like the power of www.site2.com, I get 500 errors stating that I force too many redirects.
I have a theory that my solution above should be a little more specific to make sure that it only triggers a request sent to example.com. (I think the line with anything not containing / site / is a bit wider).
I appreciate any support allowing this. Save me a little headaches!
Update II:
I do not believe that I have access to apache configuration. Only the parameter that I see in cpanel is apache handlers (not quite sure what this section does).
I will send a ticket to find out where the script server is running from. I believe that it works from "https://www.simplescripts.com". What changes would you recommend, I will add to ignore this domain?
My bluehost host launches you with the main account and then subdomains. The primary location of the account is specified by \ www. Unfortunately, this gets messy when you try to host multiple domains. That's why I use .htaccess to force access to this directory in the \ site \ directory. Thus, capturing the primary site in the \ site \ directory.
I think the transfer problem that I had with one of my subdomains was caused by WordPress trying to force a domain without www, and then I write a .htaccess file that forces www. This caused an endless loop, not my .htaccess file in question. If I can solve the problem with the templates, then I gmoney;)