Apache Mod ReWrite to strip folders or files
Posted on 2009-02-20
I am familiar with regular expressions for PERL, but for the life of me I can't seem to get these mod rewrite rules correct.
I need to strip the trailing folders or file names off of any inbound website that matches my virtual host and rewrite it to my main domain name. This includes folders that don't contain a trailing slash.
I've been able to get any files ending in .html or directories terminated with slashes to work, but I need a more general solution.