我有一個或多個文件,在我的服務器上,我想暫時或永久地隱藏用戶和搜索引擎,使用.htaccess
將這些頁面重定向到404
頁面。這意味着任何嘗試查看頁面的用戶或搜索引擎機器人都會看到一個404
頁面。.htaccess隱藏頁面404頁面
這裏是我加入到我的.htaccess
文件的一些文件重定向到404
頁的行,但它似乎並沒有工作:
RedirectMatch 404 antalya_apartment.php?bid=2&page=236
RedirectMatch 404 antalya_apartment.php?bid=3&page=129
這裏是.htaccess
代碼:
Options +FollowSymLinks +Indexes +MultiViews
RewriteCond %{QUERY_STRING} (^|&)bid=2(&|$)
RewriteCond %{QUERY_STRING} (^|&)page=236(&|$)
RewriteCond %{QUERY_STRING} (^|&)bid=3(&|$)
RewriteCond %{QUERY_STRING} (^|&)page=129(&|$)
RewriteRule ^/antalya_apartment.php?$ http://turkish-property-world.com/ [L,R=404]
那麼當你去' /antalya_apartment.php?bid = 3&page = 129'時會發生什麼? –
ChrisW
可能重複[如何重定向基於查詢字符串的URL?](http://stackoverflow.com/questions/13073253/how-to-redirect-urls-based-on-query-string) – JakeGould
奇怪的或與頁面仍然顯示,並且我得到一個HTTP響應頭狀態:HTTP/1.1 200 OK。所有我的其他htaccess RewriteRule工作正常。 –
antalya