开发者

Why does Firefox continue to show index.htm when now only index.php exists?

I used to have a page on my site called:

http://www.tanguay.info/run/index.htm

I visited it often by going to:

http://www.tanguay.info/run

with my Firefox browser and no other browser.

I have since removed that file "index.htm" and replaced it with "index.php".

Now when I go to:

http://www.tanguay.info/run

with my Firefox browser it still shows me the content of the non-existent index.htm page.

If I explicitly go to

http://www.tanguay.info/run/index.htm

it correctly shows me an error, and if I explicitly go to

http://www.tanguay.info/run/index.ph开发者_开发百科p

it correctly shows me the PHP page.

I cleared all my cache in my Firefox browser but it still shows me the non-existstent index.htm page.

All other browsers and even Firefox on all other machines I've tested show me the correct page (index.php) when they go to

http://www.tanguay.info/run

Why is this happening and what is the easiest way (e.g. with an htaccess file) for me to force my Firefox browser and potentially all other browsers which had previously been redirected to the index.htm page, to correctly show the index.php page now?


You can make sure all requests go to the index.php file by putting this in an .htaccess file inside the /run directory. You'll need to make sure you've enabled mod_rewrite in your Apache configuration.

<IfModule mod_rewrite.c>
    ## Turns ModRewrite on
    RewriteEngine On

    ## Stop infinite loops
    RewriteCond %{ENV:REDIRECT_STATUS} 200
    RewriteRule .* - [L]

    ## Allow any existing file to pass through
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule .* - [L]

    ## Pass any non-existing file to index.php
    RewriteRule ^.*$ index.php [NC,L,QSA]
</IfModule>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜