E
E
Eugene2016-03-25 20:07:25
Apache HTTP Server
Eugene, 2016-03-25 20:07:25

How to privately specify RewriteRule?

Tell me how to correctly specify the RewriteRule rule:

Redirect 301 /news/#.htm /news/#/

So that all the pages that I have design addresses:
site.ru/news/18041.htm
site.ru/news/18042.htm
site.ru/news/18043.htm
There was a 301 redirect to:
site.ru/news/18041
site.ru/news/18042
site.ru/news/18043
I'm trying like this:
RewriteRule news/[0-9]+.htm /news/??? [R=301,L]
But I don't know how to correctly register where to redirect

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Defman21, 2016-03-25
@Defman21

RewriteRule news/$1\.htm news/$1 [R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question