0

I would like to rewrite a URL using .htaccess

The URL

http://localhost/projects/notes/catagories.php?id=2

should be

http://localhost/projects/notes/catagories/2

My .htaccess file

RewriteEngine On
RewriteRule ^((?!catagories\.php)[^/]+)/?$ catagories.php?page=$1 [L]

Thanks

Schwesi
  • 4,753
  • 8
  • 37
  • 62
  • I think this answer is exactly what you are searching for: https://stackoverflow.com/a/16389034/4132369 – Schwesi Oct 07 '17 at 11:15
  • 3
    Possible duplicate of [URL rewriting with PHP](https://stackoverflow.com/questions/16388959/url-rewriting-with-php) – Abdul Waheed Oct 07 '17 at 11:22

1 Answers1

0

Try this...

change instead af

RewriteRule ^((?!catagories\.php)[^/]+)/?$ catagories.php?page=$1 [L]

this

RewriteRule ^/catagories/([0-9]+)$ /catagories.php?id=$1
Nandhi Kumar
  • 343
  • 1
  • 11