Mod Rewrite Hide Folder

后端 未结 3 1870
庸人自扰
庸人自扰 2020-12-09 22:21

I think this is a pretty simple question.

How do you an apache rewrite to hide a folder.

EX: www.website.com/pages/login.php to www.website.com/login.php

3条回答
  •  伪装坚强ぢ
    2020-12-09 22:47

    If your example actually reflects the files you need, then in your .htaccess file:

    #Options +FollowSymLinks
    RewriteEngine On
    
    RewriteRule ^/pages/(.+)\.php $1\.php [NC, L]
    

    Also, if the directory has read permission, it cannot be, in reality "hidden". I assume you mean that it no longer appears in the url.

提交回复
热议问题