0

I have an root folder like this:

ROOT
|- Service
|  |- Admin
|
|- Service 2

I'm interesting in accessing the admin folder from service folder

To access the admin path via url i use mydomain.com/Service/Admin

Is there any way to make it access like this mydomain.com/Admin without moving folders?

I got the answer from one guy and is working, but is not working if i don't add / at the end of Admin

RewriteEngine On

RewriteRule ^(Admin/.*)$ Service/$1 [L,NC]

mydomain.com/Admin/ - working

mydomain.com/Admin - not working (404 error)

I want both to work

Mando Madalin
  • 193
  • 2
  • 3
  • 14
  • Have you tried removing the `/` from the redirect rule? Meaning, something like this `RewriteRule ^(Admin.*)$ Service/$1 [L,NC]` ? – Peon Nov 14 '13 at 09:29
  • That works, but will redirect my url to `mydomain.com/Service/Admin` and i don't want that – Mando Madalin Nov 14 '13 at 09:40
  • How about this: `RewriteRule ^Admin.*$ http://mydomain.com/Service/Admin/ [R=301,L]` – Peon Nov 14 '13 at 09:43
  • Hmm, that was close, i made it like this `RewriteRule ^Admin$ http://mydomain.com/Admin/ [L,NC]` and this will redirect me to `http://mydomain.com/Admin/` workin url – Mando Madalin Nov 14 '13 at 09:53
  • Please check this link : http://stackoverflow.com/questions/10364951/make-web-root-folder-a-sub-folder-with-htaccess it should be helpful for you, – Siraj Khan Nov 14 '13 at 09:53
  • Or this one: https://kb.mediatemple.net/questions/85/Using+.htaccess+rewrite+rules – Peon Nov 14 '13 at 09:54

1 Answers1

0

I made is like this and is working

RewriteEngine On

RewriteRule ^Admin$ http://mydomain.com/Admin/ [L,NC]
RewriteRule ^(Admin/.*)$ Service/$1 [L,NC]
Mando Madalin
  • 193
  • 2
  • 3
  • 14