We have a client's site that is currently on our development server. We are having some issues formatting the .htaccess file. Currently, the htaccess file is causing a redirect to https://www.
only on inside.php
. Our goal is to make every page redirect to use https://www.
. We are currently using a base url set-up in our header.php
file that is included on every page. Unsure if there is a better way to accomplish what we are trying to do, but if there is any help would be appreciated.
Here is the current contents of our .htaccess file.
RewriteEngine on
#enables you to access PHP files with HTML extension
AddType application/x-httpd-ea-php70 .html .htm
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -l
RewriteRule ^ - [L]
#forces https://
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
#forces www
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteRule ^physicians(/((([a-zA-Z0-9_-]+)/?)*))?$ physicians.php?link=$2 [NC,L]
RewriteRule ^((([a-zA-Z0-9_-]+)/?)*)$ inside.php?page=$1
ErrorDocument 404 /inside.php