Htaccess重写规则,chrome显示网页的问题
网站在 IE 上正确显示。 Chrome 无法正确显示或跟随链接。任何想法或建议将不胜感激。如果我删除 htaccess 文件,谷歌将正确显示并且链接可以工作。
Options +FollowSymLinks
Options -Indexes
RewriteEngine on
#services
RewriteRule ^index.html$ index.php [L]
RewriteRule ^showthread_([^/]*).html$ index.php?method=showthread&id=$1 [L]
RewriteRule ^postcomment.html$ index.php [L]
RewriteRule ^maturecontent.html$ index.php?method=maturecontent [L]
RewriteRule ^randomthread.html$ index.php?method=randomthread [L]
RewriteRule ^readnotapproved.html$ index.php?method=readnotapproved [L]
RewriteRule ^contacts.html$ index.php?method=contacts [L]
RewriteRule ^about.html$ index.php?method=aboutus [L]
Website displays correctly on IE. Chrome will not dislpay correctly or follow links. Any ideas or suggestions would be appreciated. If I remove the htaccess file, google displays correctly and links work.
Options +FollowSymLinks
Options -Indexes
RewriteEngine on
#services
RewriteRule ^index.html$ index.php [L]
RewriteRule ^showthread_([^/]*).html$ index.php?method=showthread&id=$1 [L]
RewriteRule ^postcomment.html$ index.php [L]
RewriteRule ^maturecontent.html$ index.php?method=maturecontent [L]
RewriteRule ^randomthread.html$ index.php?method=randomthread [L]
RewriteRule ^readnotapproved.html$ index.php?method=readnotapproved [L]
RewriteRule ^contacts.html$ index.php?method=contacts [L]
RewriteRule ^about.html$ index.php?method=aboutus [L]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
.htaccess
文件位于服务器端:它们处理客户端的请求,并将资源(如 HTML 或图像文件)返回到浏览器。反过来,浏览器解释此 HTML 代码和/或资源,并使用其渲染引擎显示网页。
您说不同浏览器在显示您的页面时存在差异。这是完全可能的,但不可能是 .htaccess 文件造成的,因为所有浏览器,无论什么类型,在向服务器请求时总是给出相同的代码。
如果不同浏览器之间的网站外观存在差异,并且您认为原因是 .htaccess 文件,则可能意味着您的浏览器的页面缓存存在问题。浏览器应该缓存(或本地保存)一些数据以节省时间,而不必在每次访问页面时一次又一次地请求相同的数据。有时,这会出现不一致的情况 - 因此您可以通过清除浏览器的缓存来解决此问题。
如果这不是问题,请继续检查您的布局和/或 URL 方案,但我向您保证它与 .htaccess 无关。
.htaccess
files are on the server-side: they handle requests by the client, and return resources (like HTML or image files) to the browser.The browser, in turn, interprets this HTML code and/or resources and displays a webpage with it's rendering engine.
You said that there are differences between browsers in displaying your page. This is entirely possible, but it is impossible that the cause is an .htaccess file, because all browsers, no matter what type, are always given the same code when requesting from a server.
If there is a difference in appearance on the site between browsers, and you believe the cause to be an .htaccess file, it probably means there is an issue with your browser's cache of the page. Browsers, as they should, cache (or save locally) some data to save time as to not have to request the same data again and again every time a page is accessed. Sometimes, there are inconsistencies with this- so you can fix this problem by clearing your browser's cache.
If this is not the issue, keep checking your layout and/or URL scheme, but I assure you it has nothing to do with .htaccess.