I have this path in localhost (localhost/ams/forms/login.php
). I want to redirect for clean url (localhost/ams/forms/login/
) when I type localhost/ams.
Asked
Active
Viewed 46 times
0

Maytham Fahmi
- 31,138
- 14
- 118
- 137

carth
- 1
-
hey guys! i have this project which redirect to localhost/ams/forms/login.php which redirect when i type on browser localhost/ams. I try to used htaccess for a clean url but i research a lot but no answered help to accomplished the clean url or just i dont want to display .php file extension? – carth Dec 05 '16 at 03:29
-
4Possible duplicate of [Remove .php extension with .htaccess](http://stackoverflow.com/questions/4026021/remove-php-extension-with-htaccess) – robere2 Dec 05 '16 at 03:54
1 Answers
0
This for clear .php from url
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule !.*\.php$ %{REQUEST_FILENAME}.php [QSA,L]
this for redirect from old file path to new file path
Redirect /olddirectory/oldfile.html http://example.com/newdirectory/newfile.html

knizer
- 133
- 1
- 9
-
-
you want when type (localhost/ams).. redirect to (localhost/ams/forms/login/) – knizer Dec 05 '16 at 05:49