Hi,
I want my pdfs to be inlined rather than downloaded. I found this suggestion:
<LocationMatch "\.(?i:pdf)$">
ForceType application/pdf Header set Content-Disposition inline
</LocationMatch>
Which file do I add this to? I tried dispatcher_vhost.conf without success.
Thanks
Joel
Views
Replies
Total Likes
Hi,
I guess you are talking about this reference: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/apache-sling-content-dispo... Can you try to add this to your .vhost file, I guess you will have a file named like "yourBrand.vhost"
Hope this helps
Please add it to the vhost file under conf.d/available_vhosts.
Also, assure that the "Content-Disposition" header allowed in farm file.
Hi @joel_at_verb ,
you can use something like this to ensure the inline value is always set.
add this in the file dispatcher/src/conf.d/available_vhosts/<your_custom_project_vhost>.vhost
<LocationMatch "\.(?i:pdf)$">
Header unset "Content-Disposition"
Header set Content-Disposition inline
</LocationMatch>
add this at last inside VirtualHost tag
@joel_at_verb Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community
Sorry for the delay. Just other priorities. No this did not work. But I am re-learning dispatcher.
The last answer appeared to be the best. Please give me time to evaluate and I will update.
I am hoping to have an update by the end of June at the latest.
-Joel
HI @joel_at_verb ,
To configure your Apache Dispatcher to inline PDFs instead of downloading them, you can indeed use the suggested configuration snippet you provided. However, you need to ensure that it's placed in the correct Apache configuration file.
Here's how you can do it:
Locate Apache Configuration Files: Typically, the configuration files for Apache are located in /etc/apache2/ or /etc/httpd/ directory. Within this directory, there should be a configuration file for your virtual host, such as httpd.conf, vhosts.conf, or dispatcher_vhost.conf.
Add Configuration Snippet: Open the appropriate Apache configuration file in a text editor and add the following lines:
<LocationMatch "\.(?i:pdf)$">
ForceType application/pdf
Header set Content-Disposition inline
</LocationMatch>
Make sure you place this snippet within the <VirtualHost> section corresponding to your website or within a separate <IfModule disp_apache2.c> block if you're using Apache Dispatcher.
Restart Apache: After saving the changes to the Apache configuration file, restart Apache to apply the new configuration. You can do this using the following command:
sudo systemctl restart apache2 # For systemd-based systems
Replace apache2 with httpd if you're using a different distribution or init system.
Test: Once Apache has been restarted, access a PDF file on your website to verify that it's now being served inline instead of being downloaded.
By adding the configuration snippet to the appropriate Apache configuration file and restarting Apache, you should be able to configure your Apache Dispatcher to inline PDFs. If you're unsure about the location of your Apache configuration files or encounter any issues, consult your server administrator or Apache documentation for further assistance.
@joel_at_verb Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.
Views
Replies
Total Likes
I will comment when we try. Been busy with other things.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies