I want users access the cgi script for searching tags in my blog, but the script is in another directory. Is it possible to let RewriteRule to access to another directory? I tried my own method but its not working so far.
RewriteEngine on
RewriteRule ^tag/([^/]*)/$ /var/www/html/script/search.cgi?tag=$1 [L]
When a user access blog.com/tag/apple/ search.cgi searches for tag “apple”
My blog’s aboslute pass is
/var/www/html/blog/
Search script is here
/var/www/html/script/search.cgi
Change your code this:
Make sure you add this code to your .htaccess file in
/var/www/htmldirectory.