S
S
Sergey Shilov2015-04-17 14:29:28
Nginx
Sergey Shilov, 2015-04-17 14:29:28

How to redirect old links to new ones?

Put the site on a new engine. The old site formed links with the .html ending, and the new engine generates a link in php, respectively, these are 2 different links. How to register in .htaccess so that there is a simple redirect of a link to a link?
It was mysite.com/page.html and it became mysite.com/page, it is necessary that the first one redirects to the second one.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Filimonov, 2015-04-17
@DmitryPhilimonov

Something like this:

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)\.html$ $1.php?%{QUERY_STRING} [L,R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question