Website with URL rewriting not loading each time, inconsistent across different browsers

This is a test URL for a new website:

I am having very mixed results with loading it. The local copy on my computer works fine, but when loading from the internet sometimes the page will load, sometimes I will get "page not found". Then I hit "reload" and it loads again.

In Safari, sometimes it loads, but then the CSS file doesn't load so the styles are missing. Odd behavior in Chrome as well.

I'm hoping someone can load this URL in a browser or two and see if you are getting similar results. I have used this exact same test procedure on other sites but never had this happen before, so not sure what's going on.

I don't know if the .htaccess or IIRF (which is what I'm using on the Windows side) has to do with it, or perhaps even my "canonical" tag. But as I said, I have used these before in the same way, never a problem.

Brad BansnerWeb DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

If you are using IIRF then the question is why are you using it.
I get the same thing as you - hard to debug our side as we cannot see the internal workings of what you are doing.
Brad BansnerWeb DeveloperAuthor Commented:
I'm using it to do the URL rewriting, it is very similar to using .htaccess for rewriting.

Here is the other site I have setup the exact same way:

Yet, I have none of the problems. I'm not sure what is different from one site to the other, why I have problems with one, but not the other, etc.
But that site is not a sub domain of your site, so there very well could be lots of differences in the setup.
It seems to point to a redirect problem, though I'm still at a loss as to what you are are redirecting and to where.
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

Brad BansnerWeb DeveloperAuthor Commented:
This is my iirf.ini file contents:

RewriteEngine On

RewriteRule ^/?$ /default.htm [NC,L]
RewriteRule ^/?([^\.]+)$ /$1.htm [NC,L]

Open in new window

It just rewrites a folder name to the folder name + ".htm".

So this:
...turns into this:

The 2nd URL doesn't seem to have the same problems as the first, though, so I guess that points to IIRF as being the issue.
I don't know the program but seems to follow the same rules as .htaccess where I would use

RewriteRule (.+)/$ /$1.htm [NC,L]
Brad BansnerWeb DeveloperAuthor Commented:
I tried that, but now the page won't load at all. I think the original syntax was OK.

Yes, this site is a subdomain, but so is, so I don't understand why there would be any difference. Their iirf.ini files are identical.

RewriteRule ^([^\.]+)$ $1.htm [NC,L]
Brad BansnerWeb DeveloperAuthor Commented:
Done. That seems to work as well as what I had originally, but also has the same problems. I don't think its a regex problem.

My testing with Firefox seems to be as follows:

1. Load the URL, it gives "the page cannot be found".
2. Do a hard refresh, page loads OK.
3. Do a regular refresh, "the page cannot be found" again.
4. Hard refresh, page loads OK again.


1. Load the URL, the page loads but the CSS is missing along with most of the graphics.
2. Repeatedly do a hard refresh, once in a while the page loads OK.
3. Most subsequent page reloads, back to the same thing as #1.


1. Almost always loads "page cannot be found".

You may question why I'm doing this, but I really want a solid workflow that I can duplicate for a lot of future work, so that's why I would love to figure this out. I don't think I've ever seen a site behave like this before.

Then I would move my thoughts towards the server setup for the sub domain - off the top of my head I cannot think what as I don't really deal with IIS.
Brainwave! It could be adding .htm to all files including css and js

Try this
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\.]+)$ $1.htm [NC,L]
A curious thing after a certain amount of time refreshing in Chrome the page loads normally which lead me to think this may be something to do with sessions.
Just testing now how long it is before the page successfully loads between refreshes
Brad BansnerWeb DeveloperAuthor Commented:
Not sure if that helped or not, but it does make sense. Still, it isn't a problem on the other site at all. Here is my entire INI file now:

RewriteLog D:\\iirf\iirf

RewriteLogLevel 3

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/livemerchant /livemerchant/index.asp
RewriteRule ^/?$ /default.htm [NC,L]
RewriteRule ^/?([^\.]+)$ /$1.htm [NC,L]

Open in new window

There is some information in this article, just FYI:

There is also a log file, which now generates some details, not sure if that will be helpful. I was wondering if this also could have anything to do with the number/levels of slashes in the generated URLs.

The browsers are definitely behaving odd, I don't see why one page load should be any different from another. I'm not using any session data in this site, its all static HTML.
The log says nothing except the correct url's are being rewritten.

This is interesting, someone had the same problem, enabled IIS logging and it fixed it...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Brad BansnerWeb DeveloperAuthor Commented:
WOW. That fixed it. I was thinking "what could possibly be the difference between site 1 and site 2 with IIS settings". And you are right, the only thing I can think of is logging, which was turned off in site 2. But I didn't think of that until you mentioned it jsut now. Why on earth that would cause this... no idea. Thanks Microsoft!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.