Home .htaccess editing to hide folder from url & accessing main domain
Reply: 0

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

user1109 Published in May 21, 2018, 4:56 pm

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".

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.30597 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO