基本上,如果我的.htaccess
文件中没有此代码,我网站上的任何内部链接都不起作用。
但是在我的.htaccess
文件中,我收到了大量HTTP/1.1 500
错误和一些302
错误。
这是代码:
RewriteCond %{REQUEST_URI} !^/index\.php
RewriteRule .* index.php [L]
我尝试更改%{REQUEST_URI}
为%{HTTP_HOST}
. 这解决了内部链接问题,但错误仍然存在。
我将如何修改它以删除我收到的所有错误,以便我的内部链接正常工作?
PS。我的网站内置在 Joomla 中。
如果需要,这是我的完整.htaccess
文件”:
Options +FollowSymLinks
<FilesMatch "\.(ico|jpg|jpeg|png|gif|js|css|swf)$">
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 30 days"
</IfModule>
Header unset ETag
FileETag None
</FilesMatch>
RewriteEngine On
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule .* index.php [F]
RewriteCond %{HTTP_HOST} !^(m)\.candoboatloans\.com\.au
RewriteCond %{HTTP_HOST} !^www\.candoboatloans\.com\.au
RewriteRule (.*) http://www.candoboatloans.com.au/$1 [R=301,L]
Options +FollowSymLinks
RewriteCond %{THE_REQUEST} ^.*/index\.php
RewriteCond %{HTTP_HOST} !^(m)\.candoboatloans\.com\.au/index.php
RewriteRule ^(.*)index.php$ http://www.candoboatloans.com.au/$1 [R=301,L]
RewriteRule ^(.*)\.htm$ $1.html [L]
#RewriteBase /
RewriteCond %{HTTP_HOST} !^/index\.php
RewriteRule .* index.php [L]
# Check if mobile=1 is set and set cookie 'mobile' equal to 1
RewriteCond %{QUERY_STRING} (^|&)mobile=1(&|$)
RewriteRule ^ - [CO=mobile:1:%{HTTP_HOST}]
# Check if mobile=0 is set and set cookie 'mobile' equal to 0
RewriteCond %{QUERY_STRING} (^|&)mobile=0(&|$)
RewriteRule ^ - [CO=mobile:0:%{HTTP_HOST}]
# cookie can't be set and read in the same request so check
RewriteCond %{QUERY_STRING} (^|&)mobile=0(&|$)
RewriteRule ^ - [S=1]
# Check if this looks like a mobile device
RewriteCond %{HTTP:x-wap-profile} !^$ [OR]
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC,OR]
RewriteCond %{HTTP:Profile} !^$
# Check if we're not already on the mobile site
RewriteCond %{HTTP_HOST} !^m\.
# Check to make sure we haven't set the cookie before
RewriteCond %{HTTP:Cookie} !\mobile=0(;|$)
# Now redirect to the mobile site
RewriteRule ^ http://m.candoboatloans.com.au%{REQUEST_URI} [R,L]