How to reuse my . htaccess

Asked

Viewed 24 times

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.exemplo.com/noticias/id

  • Rewriterule (.*)$ $1.php Following the example this rule would look for the following file: noticias/id.php You can use a tool to manage routes.

1 answer

0

In the last row:

RewriteRule ^(.*)$ $1.php

Alters to

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

Just change ? param=$2 and id=$3 with your get variables.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.