.pdf to .pdf redirection
3 posts
• Page 1 of 1
.pdf to .pdf redirection
I'm new to doing redirects so go easy
I've then been asked to do .pdf file to .pdf. My code is below.
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
![Smile :)](./images/smilies/icon_e_smile.gif)
- 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
Re: .pdf to .pdf redirection
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]
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]
Re: .pdf to .pdf redirection
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.
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 11 guests