Is there anything else that needs to be accessible outside cgi-bin? For example, is there something like a www.example.com/index.html that you still need to be able to get to, or is everything on the whole website through the MODx installation in cgi-bin?
At the most basic level, your .htaccess file would look something like this:
Options -Indexes
RewriteEngine On
RewriteRule ^(.*)$ cgi-bin/$1 [L]
Then, to avoid an infinite redirect loop, you’ll need to enable the .htaccess file in the MODx folder, which it sounds like you already did.
Give that a try, and let me know how it works out.
I'm learning more about MODx all the time and loving it.
-
☆ A M B ☆
- 326 Posts
Thanks for your help, but that didn’t seem to work. I should clarify one thing, though, because I don’t think my original explanation was accurate. The sites are hosted on a www2 server where every sub-site has a unique username ("~awesomesite" in the example below), so the real domain is a little different from the domain people see. For example:
A visitor types in www.awesomesite.example.com
This takes them to what is actually hosted at www2.example.com/~awesomesite
So, technically, my MODx install is hosted in the www2.example.com/~awesomesite/cgi-bin/ directory, not in www.example.com/cgi-bin as I originally said.
Does this make sense? Does it change what will work for me here? Also, is it possible that I can’t use any of the "Options" in my .htaccess, since I can’t use FollowSymlinks?
Sorry for taking so long to get back to you. I don’t think the "Options" will make a difference. I just have it in there for some extra security because it disallows access to directory trees (if there is no index.html or similar in a folder). I’ll leave it out for simplicity.
mod_rewrite usually takes me a while to get right any time I need to do a certain something, but try this. It might not work, but hopefully it’ll give you something.
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)$ cgi-bin/$1 [L]
Then make sure you have this in .htaccess file in cgi-bin (the one MODx creates as ht.access when you install it):
I set up something like you described on my website, and it works with that mod_rewrite code. Hopefully it’ll work for you.
I'm learning more about MODx all the time and loving it.