Encountering HTTP 404 Errors in Specific Directories when Accessing Server Hostname Using Chrome and Internet Explorer (PHP running on IIS)

I am encountering an issue where I am unable to access specific directories on my website due to URL corruption, but this problem only occurs with certain browsers when addressing the server hostname instead of 'localhost'.

My PHP web application is hosted on an IIS Server. After testing the app on Firefox, Edge, Chrome, and Internet Explorer, everything works perfectly when using 'localhost' as the address. However, when accessing the server hostname, it only works correctly on Firefox and Microsoft Edge.

When trying to access the hostname using Internet Explorer or Chrome, I either receive the correct page with improper CSS, encounter 404 errors, or see ERR_CONNECTION_RESET messages, along with incorrect directory loading in the URLs.

Although I am using the IIS Rewrite Module to rewrite visible directories, the fact that the issue persists when addressing the original directories leads me to believe that the root cause may lie elsewhere.

Within the application, I utilize includes with relative paths which seem to be interpreted differently by various browsers. Is migrating to absolute paths throughout the entire application the only solution, or are there alternative ways to address this problem?

Thank you for your assistance!

Answer №1

It seems that the issues I was experiencing were actually a combination of different problems all happening at once:

  • The 404 errors I was seeing before have now disappeared, possibly due to clearing cached information and cookies.
  • Internet Explorer is now able to load all pages, but is having trouble with some CSS elements. I am currently investigating other potential causes for this issue.
  • Chrome was blocking the website due to certificate problems, resulting in the ERR_CONNECTION_RESET message. After resolving these issues, Chrome is now running smoothly.

Thankfully, it appears that the relative paths used in the PHP code were not related to the problems I was facing.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Implementing websocket functionality in Yii framework

I am currently working on integrating websocket functionality into my web application using PHP and as an extension for Yii. This will allow me to create a notification system similar to what I have in mind. My starting point is the code available at the ...

Regular expressions are compatible with JavaScript, but unfortunately, they are not supported

After successfully implementing this regex in my JavaScript for webpage validation, I attempted to incorporate it into my PHP script as a backup. However, every string I passed through the regex failed, even correct names. In an effort to resolve the issu ...

Ways to increase the value of a multidimensional array

In my current code, I am attempting to increase the value of caps by 1 whenever an event with type 10 or 11 is encountered in a loop. However, when running the code, I am encountering an offset 1 error specifically on the line $red_stats[$i]['caps&apo ...

Retrieve numerical values from a JSON file using PHP

The code I currently have is causing an issue: $json = file_get_contents('https://api.coinmarketcap.com/v1/ticker/?limit=0'); $coins = json_decode($json, true); foreach($coins as $coin) { echo $coin->24h_volume_usd; } Upon running the scri ...

Leverage PHP to retrieve the value from a jQuery div element

One of my <div id="single-home-container"></div> is showing a value generated by a jQuery script. Is there a way to utilize PHP in order to retrieve that value for the purpose of passing it into a MySQL query? Thank you. ...

Tips for displaying reCaptcha responses above or below the contact form

Previously, @ADyson provided a solution on how to display returns on a new page. I appreciate the help, but I would prefer to see it under the contact form on that specific contact page. I was advised to use an echo statement and an if statement, which I&a ...

Show the form when the button is clicked

I want to create an application that allows users to click on a button in the top right corner (check image) to hide one div (topics) and show another div (a form for adding a new topic). Here is what it looks like: https://i.stack.imgur.com/YeRTw.png ...

What is the best way to retrieve a specific section of text from a variable that holds XML information in PHP?

As a newcomer to PHP programming, I need assistance. I have a variable called $output that holds an XML response obtained from a server. How can I extract the "value" data and assign it to a different variable? For instance, let's say we want to assig ...

What is the best way to retrieve the AJAX response value or string and incorporate it into an if statement?

Need help with using a success ajax response value/string in an if condition. In PHP, "valid" will be echoed if the request is successful, otherwise "invalid" will be echoed. $("#submit-login").click(function () { var email = $('#mailInput2&apo ...

I am unable to retrieve the information sent through CURL using the POST method

Recently, I started using Postman to send a POST request to an "Api server" built with Codeigniter 3 (which only prints the $GLOBALS variable). However, when I make the call, the body data doesn't appear. So, I decided to try a small script using CURL ...

displaying the worth of my models on a Codeigniter view

Recently started working with codeigniter and encountering some issues with my function. Below is the code snippet from my model: public function kode_unik(){ $q = $this->db->query("select MAX(RIGHT(id_obat,5)) as code_max from obat"); $cod ...

Tips for showing form values in pop-up boxes based on their unique identifiers

I am experiencing an issue with displaying posted values in a pop-up box. Specifically, when I click on "Book now", it only shows one set of id values for all entries. For example, if I click on the 1st row's "Book now" button, it displays the values ...

Reached the maximum number of followers allowed by the Instagram API while using PHP

I am facing an issue with retrieving all the information from my Instagram profile. When I have less than 50 followers, everything displays correctly. However, on my test profile with 7-8 followers, and my real profile with over 200 followers, the maximum ...

Display data retrieved from the database in a designated cell within an HTML table

I am attempting to display DB values in a table view with a specific layout. Here is the desired output: Plan View Within the database, I have assigned "cell names" using row/col values for each cell. You can see this setup here: DB table The following c ...

Attempting to implement a functionality that will allow users to easily delete records from the database

I've taken on a school project where I am tasked with creating a login/registration form. Additionally, I need to develop functionality that allows users to register, login, view records, and delete records from the database using a dropdown menu and ...

Tips for implementing rtlcss node package with twitter-bootstrap in Laravel framework

Recently, I've delved into using Laravel Mix for compiling SCSS and JS files, and I have a question that's been lingering in my mind. I'm looking to implement rtlcss npm to convert Twitter Bootstrap to right-to-left layout. Below is the def ...

"Encountering a crash after setting a breakpoint in xdebug version 2.4.0 for PHP

Facing a challenge while debugging PHP pages. Every time I set a breakpoint, the debugger halts at the line, but as soon as I try to continue by clicking f8, f7, or f5, the debugger crashes. After this, in the output on the browser, only what was sent be ...

The attempt to retrieve the desired date format using regular expressions was unsuccessful

I've been attempting to use a regular expression to extract dates from text details, but unfortunately, the expression I'm using doesn't return any results. Here's the PHP code snippet I have for extracting dates: <?php preg_match( ...

How to Conceal File Extensions with .htaccess

Can anyone provide guidance on the best way to hide .php extensions using HTAccess, even for sub-folders? I have attempted various solutions from previous answers but none seem to work. ...

PHP constructor with initialized class attribute fails to retain value

Currently, I am trying to include a class in my project. After setting up the class attribute in the constructor, it appears that the class is not keeping the assigned value. When I manually set the attribute value within the method, everything works as e ...