vendredi 29 juillet 2016

redirect entire website to subfolder

I dont want my website to be in the root folder of my webspace! The aim of this is to create a folder that is not accessible through the web.(eg secure files, downloads)

I've tried to redirect but I dont get it to work 100%

example:

-root
--downloads
--web
---f1
--.htaccess

my htaccess file:

<ifmodule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^(.*)$ /web/$1 [L,NC]   
</ifmodule>

this works quite well url.com gets redirected to url.com/web without changing the url in the addressline.

but here the problems start as soon as i try to access a folder like url.com/f1 it gets redirected to (and displayed as) url.com/web/f1, what i dont want to be shown in the addressline.

furthermore i still can access url.com/downloads which i expected to be redirected to http://ift.tt/2ajkf56

can someone please explain to me hot to fix this, or what is the correct way to achieve this.




Aucun commentaire:

Enregistrer un commentaire