2013-03-07 147 views
0

我有一個問題。我想通過301重定向到htaccess將我的網站地址從www.lapnet.net.pl重定向到lapnet.net.pl。總是當我嘗試使用此代碼:301重定向,冗餘index.php

Options +FollowSymlinks 
RewriteEngine on 
RewriteCond %{HTTP_HOST} ^www.lapnet.net.pl 
RewriteRule ^(.*)$ http://lapnet.net.pl$1 [R=permanent,L] 

瀏覽器重定向我http://lapnet.net.pl/index.php?view= (視圖可變負責加載內容)。我怎樣才能避免這個「index.php?view =」? 感謝您的幫助

+0

可能你已經重寫了上層文件夾中的'.htaccess'文件 – 2013-03-07 16:30:07

+0

我認爲你要求重寫規則做這樣的事情:'http://site.com/index.php?view=1 => http: // site.com /視圖/ 1'。如果是這樣,請重新填寫你的問題。 – JRomero 2013-03-07 16:31:15

+0

這條規則中沒有任何東西會添加*'/index.php?view=',所以要麼有另一個重寫規則生效,要麼代碼中有一些東西在做另一個重定向。 – Sammitch 2013-03-07 16:36:53

回答

0

最後一行看起來可疑對我說:我會域後添加/並添加查詢字符串,但我不知道這是你的問題的原因:

RewriteRule ^(.*)$ http://lapnet.net.pl/$1 [R=301,L,QSA] 
                ^^^ add original query string 
            ^slash here