Here's a file structure:
www.abc.com/123/456/ <= dir where html files will be
www.abc.com/123/456.html <= all html files placed in www.abc.com/123/456/ are to be redirected to this one
There's a .htaccess file I HAVE to use because it's a switch - here's what's written in it:
- Code: Select all
RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteRule ^$ /XYZ.cgi?%{REQUEST_URI} [L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_URI} !/.*/
RewriteRule ^.*\.html$ /XYZ.cgi?%{REQUEST_URI} [L]
XYZ.cgi file is what does the redirects under certain criteria (unimportant here), so it has to be there.
Same 2-file switch already works on the same site, but in its root - all html files placed in root of www.abc.com are redirected to www.abc.com/DIR/.
I have forced it (kinda) to work like this:
above .htaccess file is placed in 123/456/ directory and XYZ.cgi file is placed in the root, but the result is not what I'd like to have. All it does is redirect 123/456/ dir to 123/456.html file, but when exact path to html files in 456 dir is entered, it does not redirect.
I've been banging my head over this for quite some time now, blind tested many different settings with no luck - any help is more than appreciated.
TIA
EDIT: I have solved the problem. Well, not solved but avoided by adding a http://456/abc.com subdomain and now it all works as I am used to.
While fiddling with this, I have cruised the topics on this forum (that's where I got the idea after all) - this is a mighty great place.
I'll do my best to contribute in the future.