-1

i would like clean urls so when a visitor is served http://localhost/MYEVENTS/filename/ instead of http://localhost/MYEVENTS/filename.php

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /MYEVENTS/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /MYEVENTS/index.php [L]

    RewriteRule ^([a-z]+)\/?$ $1.php [NC]

</IfModule>
RedDog
  • 3
  • 4

1 Answers1

0

Try this

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php
Cybil K
  • 96
  • 10
  • How about http://localhost/MYEVENTS/filename/25/ goes to http://localhost/MYEVENTS/filename.php?event_id=25? – RedDog Sep 20 '19 at 02:56