域/頁面/asd.php
我有一個我想隱藏頁面檔案夾形式的鏈接。人們需要在鏈接上寫 domain/asdf.php 并到達檔案夾中的檔案,我該怎么做?
uj5u.com熱心網友回復:
將以下內容添加到您的.htaccess檔案中
RewriteEngine on
RewriteRule ^pages/(. )$ /$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (. ) /pages/$1 [END]
這將確保用戶只能通過新路由 ( /asd.php) 而不能同時通過 (Ie /asd.php& /pages/asd.php) 訪問 url。
查看重寫輸出
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/461982.html
