How to reuse my .htaccess

0

I have the following file

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

I can access the page without the extension. I would like to know how to pass the following url

  

www.example.com/news/id

    
asked by anonymous 05.02.2016 / 18:03

1 answer

0

On the last line:

RewriteRule ^(.*)$ $1.php

Changes to

RewriteRule ^(.*)/([a-z0-9-]+)/([0-9]+)/?$ $1.php?param=$2&id=$3

Only change the? param = $ 2 and id = $ 3 with the variables of your get.

    
05.02.2016 / 18:21