Friday 27 October 2017

php - .htaccess issue with folder

I have an .htaccess file in my root directory with the
following contents:



RewriteEngine
On
RewriteCond %{SERVER_PORT} 80

RewriteRule ^(.*)$
https://website.com/$1 [R=301,L]
DirectoryIndex index.php
Options
-Indexes


Works perfect
in the root.



The problem is with subfolders. If
I manually go to:
http://www.website.com/myfolder
it pushes me
to:

https://website.com/myfolder/.php (404
error)



My goal is to always remove the "www" and
redirect to SSL for the root and all subfolders. Obviously without the above error where
it somehow leaves the ".php"



Please
help!



Thanks!

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...