Issue
Any http request (e.g. to pdf) should be redirected to validate.php so if you call an URL (e.g. http:...../whatever/whatever/1.pdf
), htaccess should execute validate.php instead.
I went through many examples on web and stackoveflow, no luck yet. Since most work fine for many people, I guess there must be something wrong with my server.
How can I solve this issue?
Thanks
Note: htaccess and validate.php files are stored in the root.
- .htaccess - How to redirect all urls to url.php except index.php
- htaccess Redirect All Requests to Index.php Script
- How to redirect all requests to a file, except images using Apache?
- Redirect All Requests To Index.php Using .htaccess
And many more.
Solution
put this code in your DOCUMENT_ROOT/.htaccess
file:
RewriteEngine On
RewriteRule \.pdf$ /validate.php [L,NC]
Answered By - anubhava
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.