.pdf to .pdf redirection

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 2
Joined: 25 Jun 2013, 05:35

.pdf to .pdf redirection

25 Jun 2013, 06:28

I'm new to doing redirects so go easy :) I've then been asked to do .pdf file to .pdf. My code is below.

Code: Select all
RewriteRule ^(/link that doesn't work.pdf)$ /_assets/documents/workingdoc.pdf [NC,R=301]


I need to get it when they click on /link that doesn't work.pdf it is redirected to /_assets/documents/workingdoc.pdf so it opens the pdf file. Have I got this the correct way around?

Any help much appreciated

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: .pdf to .pdf redirection

25 Jun 2013, 08:01

Hello,

Yes, generally you put it correctly, although parenthesis are not necessary:

RewriteBase /
RewriteRule ^link\ that\ doesn't\ work\.pdf$ /_assets/documents/workingdoc.pdf [NC,R=301,L]

User avatar
Posts: 2
Joined: 25 Jun 2013, 05:35

Re: .pdf to .pdf redirection

27 Jun 2013, 06:32

Anton, thank you for the quick reply as it cleared up if I was doing it right. I managed to see that it wasn't working as the link was used earlier in the redirects .ini file.

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 11 guests