Rewrite rules not applying on cgi-bin URLs

theRKF

Well-Known Member
#1
We have recently migrated a client to our server. Their old website relied on cgi, whereas our platform does not. In an effort to be SEO friendly we created a bunch of 301s from their old URL structure to the new.

Most are working, but anything with a /cgi-bin/ URL goes straight to 404.

Example: http://www.example.com/cgi-bin/abcitem-dba.cgi/SKU-1234

Several of us have tried numerous solutions, including redirectmatch, request_uri conditions, and more. No joy.

All of our rules are passing in the htaccess testing tools, but not on the LiteSpeed-powered server.

Any suggestions?

The server uses cPanel, and we have tried disabling cgi privileges for the account, and removing the cgi-bin directory.
 

mistwang

LiteSpeed Staff
#2
It is more likely because the /cgi-bin/ scriptAlias configuration in Apache vhost, have you tried adding 301 redirect under /cgi-bin/ directory?
 

mistwang

LiteSpeed Staff
#4
ScriptAlias is part of the cPanel vhost template, unless you totally get rid of it.
Anyway, looks like we have to use vhost level rewrite rules to get around it.
Enable cPanel VirtualHost include file, add those rewrite rules to the include file.

Make sure it has leading slash when you match the URL, whereas rules in .htaccess has leading '/' stripped.
 
Top