Mambo and mod_rewrite



I am running Mambo out of a subdirectory: Apparently, Mambo needs mod_rewrite for SEF (a subject I’m not clear about, but think I need). My question is, what do I need to put into my root .htaccess? Right now it just does a permanent redirect to ./mambo/index.php. Also, mambo has it’s own .htaccess. Can I leave it as is?



Your “root” access should be left alone, as it already does everything necessary for mambo to function. In yourdomain/mambo/ directory, simply rename the supplied htaccess.txt to .htaccess and you will be good to go with the default mambo SEF feature (once you have configured mambo to use it in your admin back end, of course).



Does the mambo .htaccess take care what’s needed for mod_rewrite? It’s my understanding that you don’t get mod_rewrite by default under php-cgi.

The only thing that bothers me is that when I look at the PHP info tab off the system menu in mambo, I don’t see anything about mod_rewrite, which in the mambo forums states need to be there.

Also, in my mambo .htaccess I have this entry:
RewriteBase /mambo

Is this right in my situation?



If I am not mistaken, you will not see mod_rewrite in the info.php; I believe this is an Apache module, and Dreamhost servers are compiled with mod_rewrite supported.

The .htaccess file defines the re-write rules for Apache, not specifically PHP and is not entirely dependant on whether or not PHP runs as CGI or as an Apache module. If I have read the Knowledge base correctly, there are some PHP functions and environment variables that are not fully supported when PHP is run as CGI, but I have yet to experience a problem with mod_rewrite. Actually, I have not reserched it that much as, on the numerous mambo installations I have done on Dreamhost, it just works , running PHP as CGI.

My .htaccess operates with the entire RewriteBase variable section commented out. Following the logic that the comment said “if your server…”, I tried it leaving it commented and it works fine. I suspect, however, that mambo is looking for a path from this variable, and per you description I would suspect that might be something like

I suggest leaving the “RewriteBase” stuff commented in the .htaccess and try it…if it doesn’t work you can alway go back and plug in the “base” path.

You can tell if it iw working, by inspecting the urls produced when you hover a cursor over a link. “rewritten” urls will have “/” as seperators and not “?” in them when in the mambo “frontend”.

I am sure a php pro around here can give you a more correct and technical explanation; i just answered because it worked for me and I wanted to help.



Thank you very much. That was exactly what I was looking for.

Now, my next challenge is getting noticed in search engines. Any tricks there, relative to Mambo? I’ve read the Mambo forums on this topic, but I’m afraid most is over my head…


I’ve never found any good “silver bullet” for search engine rankings…tons of scams and SEO spams out there that I believe generally will eventually get you caught and demoted by the engines you might try to abuse.

My best advice r.e. search engines in general are:
1 - Lots of relevant text in content and titles
2 - Use metatags properly
3 - Submit your site to the engines’ spiders
4 - get linked from other places as much as you can

Mambo makes the first two items very easy, as each piece of content has metatag parameters and places for descriptions and titles. Make use of these, submit your site to the major engines, and try to get other to link to you…it takes time, but my sites have done well enough using these, and only these, methods.

Depending on the nature of your site, the,, and forums are heavily trafficked and seem to be tolerant of “gentle” link-spamming as long as the subject matter is truly mambo related (usually just a sig line link) YMMV, as usual.

Search Engine Optimization is a huge, and sometimes contentious discussion…probably better moved to its own thread :wink: