Mando Madalin
Mando Madalin

Reputation: 193

htaccess rewrite rule accesing folder without moving it

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?

Upvotes: 1

Views: 35

Answers (2)

Samuel Cook
Samuel Cook

Reputation: 16828

.htaccess

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^Admin/ Service/Admin/index.php [L]
</IfModule>

I haven't tested this, but i believe it should work

Upvotes: 1

anubhava
anubhava

Reputation: 785286

You can try this rule in your DOCUMENT_ROOT/.htaccess file:

RewriteEngine On

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

Upvotes: 1

Related Questions