A
A
art_y102019-03-27 16:41:18
Apache HTTP Server
art_y10, 2019-03-27 16:41:18

Redirect via RewriteRule to a folder with files. How?

The site has moved to a new engine.
On the old engine there were links to instructions of the form /instruction.php?instr=blabla.pdf
On the new engine there is no instruction.php file, the instruction files are in the /media/ folder
How to redirect from /instruction.php?instr=blabla.pdfto ZY using /media/blabla.pdf
RewriteRule . The file names can be different, that is, a template is needed
Did it this way, does not work
RewriteRule ^instruction.php?instr=(.*)$ media/$1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Valentin, 2019-03-27
@art_y10

RewriteEngine On
RewriteRule ^media/([^/]*)$ /instruction.php?instr=$1 [R=301, L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question