I need to hide the pdf file extension that is opened in my web system. I did some research and I saw that I had to do the htacces, but I did not succeed. How can I do this?
I need to hide the pdf file extension that is opened in my web system. I did some research and I saw that I had to do the htacces, but I did not succeed. How can I do this?
You can do this by using your .htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.pdf -f
RewriteRule ^(.*)$ $1.pdf
I was able to do what I wanted. My URL was as follows: /gedphp/upload/id_do_registro/arquivo.pdf. So I used the following settings:
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.pdf -f RewriteRule ^upload/([0-9]+)/(.+)$ upload/$1/$2.pdf