mod_rewrite (part 2)
Posted: Thu Aug 10, 2006 11:51 pm
Ok, I am trying to get the mod_rewrite to work for me on my Ubuntu server to give me nice SEF (search engine friendly) url's.
However: I still am having trouble with it
(see: http://www.s9y.org/forums/viewtopic.php?t=6324)
The biggest problem I run into is that ALL urls I use now, point to the root file (/var/www) of my server, which I don't want.
Now, this happens to be a common problem as I understand it: see the Sy9 FAQ http://www.s9y.org/11.html#A13.
The solution stated in the FAQ is:
Now, this is pretty all confusing for me....
And I do care about performance as well....
So bottomline: is there another way to use mod_rewrite - or any other solution to get SEF url's for that matter - without having to use .htaccess files that pull your performance down?
However: I still am having trouble with it
(see: http://www.s9y.org/forums/viewtopic.php?t=6324)
The biggest problem I run into is that ALL urls I use now, point to the root file (/var/www) of my server, which I don't want.
Now, this happens to be a common problem as I understand it: see the Sy9 FAQ http://www.s9y.org/11.html#A13.
The solution stated in the FAQ is:
However when you check the official Apache .htaccess guide they actually tell you that this is not so good (apart from the fact it doesn't seem to work for me anyway), and I quote:You need to put a .htaccess file into each subdirectory which is not related to Serendipty. The only contents of this file needs to be "rewriteengine Off". With this you tell the Webserver that the directory is independent from Serendipity and thus no Serendipity Rewrite-Rules shall be applied
See: http://httpd.apache.org/docs/2.0/howto/htaccess.htmlIn general, you should never use .htaccess files unless you don't have access to the main server configuration file. There is, for example, a prevailing misconception that user authentication should always be done in .htaccess files. This is simply not the case. You can put user authentication configurations in the main server configuration, and this is, in fact, the preferred way to do things.
(...) in general, use of .htaccess files should be avoided when possible. Any configuration that you would consider putting in a .htaccess file, can just as effectively be made in a <Directory> section in your main server configuration file.
There are two main reasons to avoid the use of .htaccess files.
The first of these is performance. When AllowOverride is set to allow the use of .htaccess files, Apache will look in every directory for .htaccess files. Thus, permitting .htaccess files causes a performance hit, whether or not you actually even use them! Also, the .htaccess file is loaded every time a document is requested. (...)
The second consideration is one of security. You are permitting users to modify server configuration, which may result in changes over which you have no control. Carefully consider whether you want to give your users this privilege. Note also that giving users less privileges than they need will lead to additional technical support requests.(...)
Now, this is pretty all confusing for me....
And I do care about performance as well....
So bottomline: is there another way to use mod_rewrite - or any other solution to get SEF url's for that matter - without having to use .htaccess files that pull your performance down?