奇怪的事情发生(至少对我来说)。我有一个链接
<a href="https://example.com/profile?code=533"> Name </a>
当我单击链接时,打开的页面
https://example.com/member?code=533
代替
https://example.com/profile?code=533
当我右键单击链接,然后在新选项卡中打开时,将在新选项卡上加载正确的URL。
我不知道发生了什么。在SO上尝试了所有类似的问题,尝试禁用缓存,清除缓存。检查了.htaccess
,但由于该网站上的所有其他链接均正常工作,因此我看不到任何问题。
这是我的.htaccess
#Https redirection
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Remove .php extension
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
# redirect the blank request to the home page ( normally it is index.html )
RewriteCond %{REQUEST_URI} ^/$
# Remove WWW from URL and preserve http or https
RewriteCond %{HTTPS} =on
RewriteRule ^(.*)$ - [env=proto:https]
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ - [env=proto:http]
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
# BEGIN Expires
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType text/html "access plus 1 seconds"
ExpiresByType image/gif "access plus 604800 seconds"
ExpiresByType image/jpeg "access plus 604800 seconds"
ExpiresByType image/png "access plus 604800 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 604800 seconds"
ExpiresByType application/x-gzip "access plus 604800 seconds"
ExpiresByType application/x-javascript "access plus 604800 seconds"
</ifModule>
# END Expires
# BEGIN Caching
<ifModule mod_headers.c>
<filesMatch "\\.(ico|map|pdf|flv|jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
<filesMatch “\\.(map)$”>
Header set Cache-Control "max-age=604800, public"
</filesMatch>
<filesMatch "\\.(css)$">
Header set Cache-Control "max-age=604800, public"
</filesMatch>
<filesMatch "\\.(js)$">
Header set Cache-Control "max-age= 604800, private"
</filesMatch>
<filesMatch "\\.(xml|txt)$">
Header set Cache-Control "max-age= 604800, public, must-revalidate"
</filesMatch>
<filesMatch "\\.(html|htm|php)$">
Header set Cache-Control "max-age=1, private, must-revalidate"
</filesMatch>
</ifModule>
# END Caching
在Chrome的开发者控制台中,当我点击链接时,我看到
Status Code: 301 Moved Permanently
可能是什么问题?
注意:我无权访问服务器。只是到站点文件。