2013-08-28 15 views
0

我有一個工作國防部重寫。國防部重寫鏈接,並禁用原始

RewriteEngine On 
RewriteRule ^notifications$ /notifications.php [L] 

不過,我已經看到了一些網站,他們的鏈接似乎都喜歡website.com/login website.com/notifications website.com/profile

我想我可以達到同樣的結果與我的mod重寫。但是,我怎麼能阻止用戶像其他網站一樣進入我的/notifications.php頁面呢?

謝謝!

回答

1

添加另一個規則,查找對php文件的直接請求,並將其重定向到非php網址:

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /notifications\.php 
RewriteRule^/notifications [L,R=301]