我试图让我们的网站重定向到资产库。因此,hexarmor.com/library应该重定向到http://209.62.107.135/cgi-bin/ImageFolio43/imageFolio.cgi
,而不是您发送到http://209.62.107.135/cgi-bin/ImageFolio43/imageFolio.cgi/?/library/
添加/library/
会导致500服务器错误。为什么这个变量与我的重定向一起传递,我该如何删除它?我在下面包含了我的整个htaccess。感谢您的任何帮助,您可以提供。
RewriteEngine On
Redirect 301 /library http://209.62.107.135/cgi-bin/ImageFolio43/imageFolio.cgi
Redirect 301 /library/ http://209.62.107.135/cgi-bin/ImageFolio43/imageFolio.cgi
RewriteCond $1 !.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
FileETag MTime Size
ExpiresActive On
<FilesMatch "\.(ico|jpg|jpeg|png|gif|js|css|swf)$">
ExpiresDefault "access plus 7 days"
</FilesMatch>
# gzip on Apache 2
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml text/javascript text/css application/x-javascript application/xhtml+xml application/javascript
# these browsers do not support deflate
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
答案 0 :(得分:0)
在表弟的帮助下解决了这个问题。想象一下,我会努力帮助未来有类似问题的访问者。
供参考
Redirect 301 /library http://209.62.107.135/cgi-bin/ImageFolio43/imageFolio.cgi
Redirect 301 /library/ http://209.62.107.135/cgi-bin/ImageFolio43/imageFolio.cgi
改为
RewriteRule ^library$ "http\:\/\/209\.62\.107\.135\/cgi\-bin\/ImageFolio43\/imageFolio\.cgi" [R=301,L]
RewriteRule ^library/$ "http\:\/\/209\.62\.107\.135\/cgi\-bin\/ImageFolio43\/imageFolio\.cgi" [R=301,L]
将重定向更改为重写规则,而不是在结尾处设置301重定向标记。
[R=301,L]
目标网址在引号中并使用正斜杠进行转义。希望这会有所帮助。