Reputation: 4962
I have the following file structure
- example.com
- - app
- - - index.html
- - api
- - - index.php
How can I redirect my domain local.example.com to app/* and local.example.com/api/ to api/* ?
Upvotes: 1
Views: 86
Reputation: 19016
Assuming local.example.com
's document root is example.com
folder...
You can put this code in your htaccess (which has to be in root folder example.com
)
RewriteEngine On
RewriteCond %{HTTP_HOST} ^local\. [NC]
RewriteRule ^(?!(?:api|app)/)(.*)$ /app/$1 [L]
Upvotes: 1