0

OK I am using this right now and its partly working

when i write www.example.com/foo it goes to www.example.com/foo.php but when i try and pass something like www.example.com/foo/1 it gives

Not Found

The requested URL /Test/foo/1.php was not found on this server.

it takes the 1 makes it as 1.php which is wrong

I want to keep it as dynamic as possible so i want to redirect as $1.php but be able to pass at least one param

I do not want to hard code each file and param for in the .htaccess, is this possible and how would i do it?

here is what i have right now

Options -MultiViews

RewriteEngine On
RewriteBase /Test/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
Jake Dawsen
  • 141
  • 1
  • 1
  • 10
  • possible duplicate of [Remove .php extension with .htaccess](http://stackoverflow.com/questions/4026021/remove-php-extension-with-htaccess) – Ohgodwhy May 24 '15 at 00:24
  • @Ohgodwhy this is what i got from that question this works `www.example.com/foo` but then when i write `www.example.com/foo/1` its give a `The requested URL /Test/foo/1` was not found on this server for some reason? when there is a file named foo : `RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule !.*\.php$ %{REQUEST_FILENAME}.php [QSA,L]` – Jake Dawsen May 24 '15 at 00:55

0 Answers0