Hello, I'm working on script, and want to set links to be as following: www.mysite.com/sign-up.php to www.mysite.com/sign-up I found this code and works for me. RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.+)$ $1.php [L,QSA] Code (markup): BUT if I add a slash at the end of link, ex: www.mysite.com/sign-up/ it shows me this error Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator at admin@example.com to inform them of the time this error occurred, and the actions you performed just before this error. More information about this error may be available in the server error log. Code (markup): Q2- if the user try to access any php extension, I want him to redirect to same link without extension EX: www.mysite.com/sign-up.php to www.mysite.com/sign-up Thank you
I replaced so my .htaccess looks like RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*?)/?$ /$1.php [L] Code (markup): but now all links doesn't work shows me file not found
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.+)$ $1.php [L,QSA] RewriteRule ^(.*)/$ $1 [R=301,L] Code (markup): thanks but same problem