Welcome to WebmasterWorld Guest from 54.160.131.144

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Restful redirect gives 404 in IE only

     

newbies

5:40 pm on May 3, 2014 (gmt 0)

10+ Year Member



Hi all

I have a php program which has used mod rewrite to remove index.php in url. It works in all browsers except Supid IE. IE would load the page for less than a second then it redirect to a 404 page. This occurs in all IE versions. If I turn off Display friendly error message, it works fine. below is my htaccess file.

Thank you for help.

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^bladd(.*)$ /index.php/bladd$1 [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php/index/$1 [QSA,L]

lucy24

7:10 pm on May 3, 2014 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



I don't see the redirect. You're only showing the back half: where you rewrite the new request to serve content from index.php. What does the redirect itself look like?

If I turn off Display friendly error message, it works fine.

Turn it off where? Is this a setting in your personal browser, or is there a CMS involved?

Does MSIE still do that annoying thing where if a custom error message is too short, they show a generic default instead? Don't see how this could apply to redirects, though.

newbies

12:11 pm on May 4, 2014 (gmt 0)

10+ Year Member



>>Turn it off where? Is this a setting in your personal browser, or is there a CMS involved?

the setting is in under advanced tab in IE.

aristotle

3:56 pm on May 4, 2014 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



Are you talking about the setting called "disable script debugging"?

That's supposed to only be used for testing code. For general browsing, it's supposed to be turned off.

tangor

4:10 pm on May 4, 2014 (gmt 0)

WebmasterWorld Senior Member tangor is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



Info note on IE, not an answer to the question above (though it might be...)

If the disable script function keeps activating, do not do it in IE itself. Close IE then use the Start/Control Panel/Internet Options and do it from there. Close that down then start IE again. Sometimes IE will not keep a setting while it is running.

not2easy

4:31 pm on May 4, 2014 (gmt 0)

WebmasterWorld Administrator 5+ Year Member Top Contributors Of The Month



It sounds more like one of the Advanced Options in IE Settings: "Display friendly error messages". If the Rewrite is returning a 500 error for example and no custom error page exists, it could give you a 404.

lucy24

8:03 pm on May 4, 2014 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



Oh, ###, didn't think of that. We need to separate two things: what's happening in the server, and what MSIE says is happening.

Two sources of information:
-- server logs. Does the request return a 301? If the redirect happens in-page or in a php script, as implied by the OP, logs will be useless because they will always show a 200. But check them first.
-- a tool such as Live Headers in Firefox. This will show you what numerical response is returned to the browser, regardless of how it was initially generated.

Before you can deal with MSIE, you need to know what the underlying events are.

newbies

3:27 am on May 5, 2014 (gmt 0)

10+ Year Member



my .htaccess mod_rewrite rule works in FF and Chroma, but not in IE. IE briefly display the page for less than one second, and then it autumatically redirects the page to a 404 page. If I turn off "Display friendly error messages" in IE, it works fine.

the problem is about 10% visitors still use IE, they are unable to visit my site.

lucy24

8:31 am on May 5, 2014 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



If I turn off "Display friendly error messages" in IE, it works fine.

How can something you set in your own browser affect what is seen by external visitors to the site?

it automatically redirects the page to a 404 page

Careful. You're going to have to be very precise here. Do you mean that it redirects-- that is, the URL in the browser's address bar changes again-- or do you mean that the screen shows the content of a 404 page?

newbies

10:45 am on May 5, 2014 (gmt 0)

10+ Year Member



How can something you set in your own browser affect what is seen by external visitors to the site?

I mean it works in my own IE browser after changing the setting.

I PMed you with example URL.

newbies

11:25 pm on May 5, 2014 (gmt 0)

10+ Year Member



Hi guys,

It turns out that a link in a linked css is broken, and IE immediately redirect the page to 404. Why cannot stupid IE just silently ignore the broken link as do FF and Chroma?

Thank you all for trying to help.

tangor

1:21 am on May 6, 2014 (gmt 0)

WebmasterWorld Senior Member tangor is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



What part of the css caused that behavior in IE? That's something the rest of us would like to be aware of!

lucy24

1:29 am on May 6, 2014 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



Edit: Overlapped Citrus Hybrid again, but fortunately we're asking the same question.

Whoa there. For future reference I want to be sure I understand this.

The page itself is fine, but it links to an external stylesheet that doesn't exist. When this happens, MSIE displays the 404 page even though only the stylesheet, not the page itself doesn't exist. (Or is it the external stylesheet that in its turn links to something that doesn't exist, so we're now TWO steps away from the original page?)

Have I got that right? Does the same thing happen with any other type of linked content, such as images? All versions of MSIE, or only some?

:: tottering off to apply cold compresses to forehead ::

newbies

2:53 am on May 6, 2014 (gmt 0)

10+ Year Member



The page itself is fine, but it links to an external stylesheet that doesn't exist. When this happens, MSIE displays the 404 page even though only the stylesheet, not the page itself doesn't exist. (Or is it the external stylesheet that in its turn links to something that doesn't exist, so we're now TWO steps away from the original page?)

Yes, the broken link is a linked CSS file, two steps away. This only occurs to IE older than 10.

The symptom is IE load the page without a problem, but within a blink of an eye, it gives a 404 page. I first thought this has to do with the rules in htaccess, then someone asked me to examine my 404 error logs. That is how this problem has been solved.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month