.htaccess editing to hide folder from url & accessing main domain

早过忘川 提交于 2020-01-06 05:22:13

问题


i used a .htaccess editing to hide folder/directory from my website url. skynetbd.net/user_profile/login.php to skynetbd.net/login.php

I used this:

Options +FollowSymLinks -MultiViews

# Turn mod_rewrite on RewriteEngine On RewriteBase /

RewriteCond %{REQUEST_FILENAME}.php -f 
RewriteCond %{REQUEST_URI} !/$
RewriteRule (.*) $1\.php [L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+user_profile/([^\s]+) [NC]
RewriteRule ^ %1 [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (?!^user_profile/)^(.*)$ /user_profile/$1 [L,NC]

And it worked fine for my purpose ..but unfortunately i could not access using this domain "skynetbd.net" anymore but "skynetbd.net/index.php" !!! The server was showing:

Forbidden You don't have permission to access /user_profile/ on this server. Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

Please help on this case..i must access in my website using only "skynetbd.net".

来源:https://stackoverflow.com/questions/48657691/htaccess-editing-to-hide-folder-from-url-accessing-main-domain

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!