Author |
|
MCruz
Joined: 31 Jul 2015 Posts: 3
|
Posted: Fri 31 Jul '15 18:27 Post subject: File .htaccess |
|
|
Hi to all,
I have the following folder structure (/sites/test and /login inside www-root/):
Quote: | www-root
/sites/test ->Frontend
/login -> Backend |
With this rule:
Code: | RewriteRule %{REQUEST_URI} !(.*)sites/test
RewriteRule ^(.*)$ sites/test/$1 [L]
|
that I put on .htaccess, when I put in my browser www.mywebsites.com I access directly to the folder /sites/test and I can see the index.html page inside.
The problem is that I can not longer access to the folder /login no more. I put www.mywebsites.com/login and gives nothing.
Can someone tell me what rule I have to put to access also to /login?
To work like this:
www.mywebsites.com -> redirects to -> www.mywebsites.com/sites/test
www.mywebsites.com/login -> redirects to -> www.mywebsites.com/login
Thanks |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Mon 03 Aug '15 16:46 Post subject: |
|
|
You have to exclude the login folder, cause rewrite everything with ^(.*)$
Code: |
RewriteRule ^(sites/test|login) - [L]
RewriteRule ^(.*)$ sites/test/$1 [L]
|
|
|
Back to top |
|
MCruz
Joined: 31 Jul 2015 Posts: 3
|
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Mon 03 Aug '15 21:07 Post subject: |
|
|
Then there must be a rule to rewrite all urls. Are that all rewrite rules?
Or can you open /login/somefile.ext ? Like /login/index.php ? |
|
Back to top |
|
MCruz
Joined: 31 Jul 2015 Posts: 3
|
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Wed 05 Aug '15 18:00 Post subject: |
|
|
You may try
Code: |
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/login(.*)$
RewriteCond %{REQUEST_URI} !^/sites/test(.*)$
RewriteRule ^(.*)$ /sites/test/$1
|
|
|
Back to top |
|