sagnik Posted September 20, 2017 Posted September 20, 2017 Hi, I've a strange problem with rendering/styling. My website is working and rendering/styling fine when using http but when I'm using HTTPS, the layout of the Website gets too odd. Here is the screenshot of the Website when using HTTPS:This is what's happening when visiting https://m.whatsnew.cf: And this is what's happening when visiting https://www.whatsnew.cf/mobile: Can anyone please help me?
Krydos Posted September 20, 2017 Posted September 20, 2017 Does fixing all of these errors make your site look the way you expect?
sagnik Posted September 21, 2017 Author Posted September 21, 2017 I can't understand, why is developers console saying "Resource interpreted as stylesheet but transferred with MIME type text/html".Here is how it should look (Without HTTPS): Sir, I think, I've identified the problem. The problem is in .htaccess. I've redirected all requests to some directories to the index.php, that's why the Stylesheets loading as html as the request redirects to the index.php instead of "/global/styles.css" as access to the "/global/" directory redirects to "/index.php". But I still need help. I want .htaccess to redirect all requests to the specific directories to "/index.php". In fact, I want to show a forbidden page to those directories but instead of showing a forbidden page I want to redirect the user to the index.php. But not like one how it's working now, I want to redirect when user types in address bar.
wolstech Posted September 21, 2017 Posted September 21, 2017 Don't use htaccess for that. Just put an index.php in the folders you want to protect and use a single header() command to redirect users who enter the folder name without a specific filename on the end. A user's browser has to be able to access those folders to retrieve the style sheets, so locking the user out will break your site. By putting an index.php in there, you can still retrieve specific files if you (or the browser) knows their name, but just visiting the folder without a file name will serve the index.php, which redirects the user.
sagnik Posted September 21, 2017 Author Posted September 21, 2017 Ok, I'll try. Thanks for your help.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now