Answer the question
In order to leave comments, you need to log in
How to replace "somepage.php?id=1" with "somepage/1", etc.?
Tell me how to replace "somepage.php? id=1" with "somepage/1" and other pages similarly?
I found a solution where .php is truncated , but how to make a route from id=1 to /1?
# Запускаем движок замены
RewriteEngine on
# Если запрашиваемый объект не папка
RewriteCond %{REQUEST_FILENAME} !-d
# если запрашиваемый объект с дописанным расширением php - файл
RewriteCond %{REQUEST_FILENAME}\.php -f
# делаем замену с дописыванием .php
RewriteRule ^(.*)$ $1.php
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question