Carl
Carl

Reputation: 29

How to redirect from root directory to a file in sub directory using htaccess

I've searched a lot through .htaccess technologies, but I can't seem to find any good solutions for this issue.

I want to redirect a url like this:

http://mywebhost.com/login

to this one.

http://mywebhost.com/app/views/login.php

Preferably, I want to mask the second url to be like the first url, such that when you visit the first url, it will display the contents of the second url.

Thanks

Upvotes: 2

Views: 35

Answers (1)

Elvis Plesky
Elvis Plesky

Reputation: 3300

This rule should work:

RewriteEngine on
RewriteRule ^login/?$ /app/views/login.php [L]

Upvotes: 1

Related Questions