Redirect domain to .cgi file

If you want to redirect your domain

http://domain.co.uk

to

http://domain.co.uk/cgi-bin/test/subdirectory/test.cgi file

then add the following rewrite rule in .htaccess file

====================

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.domain\.co\.uk$ [NC]
RewriteRule ^/?$ "http\:\/\/www\.domain\.co\.uk\/cgi-bin\/test\/subdirectory\/test\.cgi$1" [R=301,L]

====================

Or

====================

http://domain.com

to

http://domain.com/cgi-bin/subdirectory/test.cgi

then add the following rewrite rule in .htaccess file

====================

RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^domain.com$
RewriteRule ^/?$ "http\:\/\/domain\.com\/cgi-bin\/subdirectory\/test\.cgi" [R=301,L]

====================

Done

Leave a Comment