K
K
kAIST2012-12-07 09:44:06
Apache HTTP Server
kAIST, 2012-12-07 09:44:06

Redirect to another server at 404

There is a site with content. After a certain time, the files become "outdated" and are sent to another server. I don't want to mess around with databases in terms of generating new links, I want to do it using apache:
The file is stored on the server example.com/prefix/path_to_file how can I redirect to files.example.com/path_to_file with 404?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Savostin, 2012-12-07
@kAIST

httpd.apache.org/docs/2.0/rewrite/rewrite_guide_advanced.html#redirect404

T
Talyutin, 2012-12-07
@Talyutin

ErrorDocument 404 example.com/prefix/path_to_file

K
kAIST, 2012-12-09
@kAIST

Hmm, I removed the path to docroot ( RewriteCond %{REQUEST_FILENAME} !-f ) and everything started working as it should, thanks!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question