Jump to content

Recommended Posts

Posted

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?

Posted

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.

Posted

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.

Posted

Ok, I'll try. Thanks for your help.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...