Jump to content

Problems With Https


sagnik

Recommended Posts

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?

Link to comment
Share on other sites

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):

dTpNvzF.png

 

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...