M
M
MaximDoshi2015-06-04 16:01:14
PHP
MaximDoshi, 2015-06-04 16:01:14

The address of the pages has changed, what to write in htaccess?

Please tell me what to write and where. In general, there was a site
site.ru/index.php?page=create+site+12+May and now it has become
site.ru/?p=create+site+12+May
, can you somehow redirect to htaccess?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
R
Roman, 2015-06-04
@romteh

RewriteEngine ON
RewriteCond %{QUERY_STRING} ^p=(.*)
RewriteRule ^.+$ index.php?page=%1 [L]

T
targrik, 2015-06-04
@targrik

RewriteCond %{REQUEST_URI} ^/index.php$ [NC]
RewriteCond %{QUERY_STRING} ^page=(.*)$ [NC]
RewriteRule .* /?p=%1 [R=301,L]

S
ShamblerR, 2015-06-08
@ShamblerR

https://donatstudios.com/RewriteRule_Generator

P
PO6OT, 2015-06-13
@woonem

RewriteEngine On
RewriteRule ^/index\.php\?page\=(.*)$ /?p=$1 [R]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question