1

I'm trying to make a page on my site with the URL of http://localhost/logout/.

I've created the /logout/ directory and the index.php file in that folder, but because I remove the extension of files when I go to http://localhost/logout/ it gives me a 404 error.

To actually get to the page I have to go to http://localhost/logout/index, which I don't want.

How do I fix this?

.htaccess:

RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.php [NC,L] Options -Indexes 

1 Answer 1

1

do not remove the .php extension, add this to htaccess :

RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.