Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a website that is the root folder It has a .htacces with below code :

RewriteEngine on
RewriteRule ^(.*)/$ $1.php

When I open http://mysite.com/login/ I got 404 not found error but when I open http://mysite.com/login without the trailing / the url will open without any problem.

I need htaccess code too set in the root directory to open php file like login.php as /login/ or login without / and with /

Regards

share|improve this question
add comment

1 Answer

Try ^([^/]+)/?$ and see if it works as expected.

share|improve this answer
    
After try this code RewriteEngine on RewriteRule ^([^/]+)/?$ $1.php i got 500 error –  Mahmood Aug 19 '12 at 16:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.