Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache 修改重写链接,并禁用原始_Apache_.htaccess_Mod Rewrite - Fatal编程技术网

Apache 修改重写链接,并禁用原始

Apache 修改重写链接,并禁用原始,apache,.htaccess,mod-rewrite,Apache,.htaccess,Mod Rewrite,我有一个工作模式重写 RewriteEngine On RewriteRule ^notifications$ /notifications.php [L] 然而,我在一些网站上看到过,他们的链接似乎都像website.com/login-website.com/notifications-website.com/profile 我想我已经取得了与我的mod重写相同的结果。但是,我如何防止用户像其他网站那样进入我的/notifications.php页面呢 谢谢 添加另一条规则,查找对php文

我有一个工作模式重写

RewriteEngine On
RewriteRule ^notifications$ /notifications.php [L]
然而,我在一些网站上看到过,他们的链接似乎都像website.com/login-website.com/notifications-website.com/profile

我想我已经取得了与我的mod重写相同的结果。但是,我如何防止用户像其他网站那样进入我的/notifications.php页面呢


谢谢

添加另一条规则,查找对
php
文件的直接请求,并将其重定向到非
php
URL:

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