Forum Moderators: phranque
For some reason IE treats the last JavaScript file inside the head element on the next version of my site as $_SERVER['REQUEST_URI']. The only thing this effects is what page IE users are redirected to after signing in and it currently redirects to the JavaScript file. When I comment the script element it seems to work perfectly fine...the thing is there is nothing PHP related to that JavaScript file...so I'm absolutely at a loss there, why wouldn't the stylesheet served just before the JavaScript file not take it's place after I commented the JavaScript file out? Both are in directories with exceptions in the .htaccess file. I can only presume it's some buggy behavior with IE...it's almost like there is some kind of trend!
Here is my .htaccess file with the relevant code...I've spent the past few hours searching and it seems to be a very vague Apache bug apparently...though if it was an Apache bug then it would effect all browsers right? I'm totally thrown off if it's specifically IE or an IE+something else sort of bug? Is my mod rewrite written incorrectly?
- John
<ifmodule mod_rewrite.c>
RewriteEngine on
RewriteRule ^(exception1/Šexception2/Šexception1.php) - [L]
RewriteRule !\.(icoŠjpg)$ index.php
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php\ HTTP/
RewriteRule ^index\.php$ [%{SERVER_NAME}...] [NC,R=301,L]
</ifmodule>
For some reason For some reason IE treats the last JavaScript file inside the head element on the next version of my site as $_SERVER['REQUEST_URI'].
Those JS files will indeed be fetched (along with all other page-included objects) as REQUEST URIs from your server unless they have been previously cached by the browser. As such, since they are not (apparently) in the /exception1 or /exception2 directory-path, and since they don't end with ".ico" or ".jpg", the requests for those JS files will be passed to your index.php file by your first rule. Perhaps you need to exclude .js filetypes from the rewrite as well?
All I can offer beyond that is a fix-up of your code, which likely won't make a bit of difference regarding this problem:
<ifmodule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/(exception1Šexception2)/
RewriteRule !\.(icoŠjpg)$ index.php
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php\ HTTP/
RewriteRule ^index\.php$ http://%{SERVER_NAM[b]E}/ [N[/b]C,R=301,L]
</ifmodule>
Your index.php to domain rewrite should end with a slash.
You can omit the <IfModule> container, unless you want this code to fail silently if mod_rewrite is not loaded on the server.
Replace all broken pipe "Š" characters with solid pipes before use.
Jim