Our marketing dept sent out an email with dozen of PDF's. We sent out an email containing HTTP links to PDF documents that are hosted on our server.
We now are moving the destination to another location.
current settings:
- Apache/2.2.24
PHP 5.3.24
is it possible to redirect the destination without sending the email again to all recipients?
My current .htaccess looks like this (in the root of the file folder)
<IfModule rewrite_module> RewriteEngine On Redirect /9/91/Demo.pdf RewriteCond %{QUERY_STRING} \.[^\\/:*?\x22<>|%]+(#|\?|$) [nocase] RewriteRule . - [forbidden]
</IfModule>- But I always get the Demo.pdf file
If I want to redirect: to --->
what should be the command?
42 Answers
In the root of your documents folder of the webserver, place a new
.htaccessfile (or modify the existing one, if you've already created one in the past).For every
.pdfdocument, place a line in the.htaccessfile with the following syntax:Redirect 301 /pdf/some-document.pdf
The Redirect directive requires mod_alias to be loaded (it usually is).
The 301 indicates that this is a permanent redirection (in contrast to 302, which would be a temporary redirection). After that is the old path of the document (relative to the location of the .htaccess file). And the last argument is the new location of the file.
Be sure to restart Apache after adjusting the .htaccess file, as it is most likely cached.
Create a folder with name as "oldfile.pdf" create an index.php file in it and add this code:
<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: " );
?>