我的RewriteRule是:
RewriteRule ^m/watch/([0-9]+)$ /m/watch.php?v=$1 [NC,L]
当我尝试转到http://www.example.com/m/watch/555时,页面被加载为空格,但当我点击view-source时,我的所有代码都在那里。为什么会这样?
如果我尝试跳过规则并转到http://www.example.com/m/watch.php?v=555页面加载正常。
.htaccess文件
# block access to ini
<Files ~ "\.ini$">
Order allow,deny
Deny from all
</Files>
ErrorDocument 404 /not_found.php
Options +FollowSymlinks
RewriteEngine on
#redirect to www
RewriteCond %{HTTP_HOST} ^brocktv.ca$
RewriteRule ^(.*)$ "http\:\/\/www\.brocktv\.ca\/$1" [R=301,L]
RewriteRule ^team$ team.php [NC,L]
RewriteRule ^team/$ team.php [NC,L]
RewriteRule ^involved$ involved.php [NC,L]
RewriteRule ^involved/$ involved.php [NC,L]
RewriteRule ^home$ home.php [NC,L]
RewriteRule ^home/$ home.php [NC,L]
RewriteRule ^m/watch/([0-9]+)$ /m/watch.php?v=$1 [NC,L]
RewriteRule ^m/watch/([0-9]+)/$ /m/watch.php?v=$1 [NC,L]
RewriteRule ^watch/([0-9]+)$ watch.php?v=$1 [NC,L]
RewriteRule ^watch/([0-9]+)/$ watch.php?v=$1 [NC,L]
RewriteRule ^isff$ ISFF.php [NC,L]
RewriteRule ^isff/$ ISFF.php [NC,L]
RewriteRule ^renderthis$ renderthis.php [NC,L]
RewriteRule ^renderthis/$ renderthis.php [NC,L]
RewriteRule ^oweek$ oweek.php [NC,L]
RewriteRule ^oweek/$ oweek.php [NC,L]
RewriteRule ^new$ new.php [NC,L]
RewriteRule ^new/$ new.php [NC,L]
RewriteRule ^m/shows$ /m/shows.php [NC,L]
RewriteRule ^m/shows/$ /m/shows.php [NC,L]
RewriteRule ^m/categories$ /m/categories.php [NC,L]
RewriteRule ^m/categories/$ /m/categories.php [NC,L]
RewriteRule ^m/social$ /m/social.php [NC,L]
RewriteRule ^m/social/$ /m/social.php [NC,L]
RewriteRule ^m/contests$ /m/contests.php [NC,L]
RewriteRule ^m/contests/$ /m/contests.php [NC,L]
# temporary redirect for jobs
RewriteRule ^jobs$ http://www.busu.net/get-involved/jobs [R,NC,L]
RewriteRule ^jobs/$ http://www.busu.net/get-involved/jobs [R,NC,L]
# 480 weeks
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "max-age=290304000, public"
</FilesMatch>
# compress the files
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript
# removes some bugs
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
Options -Indexes FollowSymLinks
RewriteCond %{HTTP_HOST} ^brocktv.ca$ [OR]
RewriteCond %{HTTP_HOST} ^www.brocktv.ca$
RewriteRule ^elections\/?$ "http\:\/\/www\.brocktv\.ca\/elections\.php" [R=302,L]
RewriteCond %{HTTP_HOST} ^brocktv.ca$ [OR]
RewriteCond %{HTTP_HOST} ^www.brocktv.ca$
RewriteRule ^isff$ "http\:\/\/www\.brocktv\.ca\/ISFF\.php" [R=301,L]
答案 0 :(得分:3)
当我去网站/ m / watch / 1时,我得到:
"NetworkError: 404 Not Found - http://www.brocktv.ca/m/watch/css/style.css?v=0.02"style.css?v=0.02
"NetworkError: 404 Not Found - http://www.brocktv.ca/m/watch/js/libs/modernizr-custom.js"modern...stom.js
"NetworkError: 404 Not Found - http://www.brocktv.ca/m/watch/js/mylibs/helper.js"helper.js
"NetworkError: 404 Not Found - http://www.brocktv.ca/m/watch/js/libs/modernizr-custom.js"modern...stom.js
"NetworkError: 404 Not Found - http://www.brocktv.ca/m/watch/js/mylibs/helper.js"helper.js
GET http://www.brocktv.ca/mediaplayer/jwplayer.js?_=1316396612274
MBP is not defined
[Break On This Error] MBP.scaleFix();
1 (line 81)
GET http://www.brocktv.ca/m/watch/js/mylibs/helper.js?_=1316396612766
404 Not Found 148ms
"NetworkError: 404 Not Found - http://www.brocktv.ca/m/watch/js/mylibs/helper.js?_=1316396612766"helper...6612766
MBP is not defined
[Break On This Error] yepnope({test: Modernizr.mq("(min-..., nope: ["js/libs/respond.min.js"]});
另外,当我删除class=class="no-js"
时,我看到了什么。我认为你有重写规则与CSS或JS文件冲突导致网站被“隐藏”
例如,包含的css文件是:css/style.css?v=0.02
,也许它应该是:/css/style.css?v=0.02