Koozali.org: home of the SME Server
Obsolete Releases => SME Server 7.x => Topic started by: countzero on August 12, 2007, 06:09:33 AM
-
To jumpstart this topic:
(Am using SME 7.2 and PHP5/MySQL5)
Create a new ibay (I will use "wordpress" in this example).
db accounts setprop wordpress AllowOverride All
db accounts setprop wordpress FollowSymLinks enabled
signal-event ibay-modify wordpress
/etc/rc.d/init.d/httpd-e-smith restart
Now .htaccess files for this ibay should have effect as everybody keeps telling me.
To test this:
1) Remove the index.html file inside the newly created ibay (not necessary, but it makes things foolproof)
2) Create a .htaccess file containing:
RewriteEngine On
3) Check the permissions of the .htaccess file.
4) http://yourdomain.com/wordpress
If you get a 500 Internal Server Error, mod_rewrite is not enabled.
Your Apache conf should contain "LoadModule rewrite_module modules/mod_rewrite.so" (it does by default)
5) Add to the .htaccess file:
RewriteRule ^(.+)\.html$ $1.php
This will translate all request as follows:
yourdomain.com/wordpress/foo.html -> yourdomain.com/wordpress/foo.php
To test, create a foo.php file in your ibay containing:
<?php
phpinfo();
?>
Check permissions.
Now try to access this file using http://yourdomain.com/wordpress/foo.html
====
However, I continuously get:
Not Found
The requested URL /home/e-smith/files/ibays/wordpress/html/foo.php was not found on this server.
-
I have just verified the above procedure using WAMP on Windows.
Here, it all works properly.
From the above error output I conclude that the .htaccess DOES WORK as the error message states "foo.php" and not "foo.html". However, the base URL seems to be replaced by the base Dir. I suspect there is some SME magic at work here that I don't know about yet.
=======
SOLUTION
=======
When I change
RewriteRule ^(.+)\.html$ $1.php
into
RewriteRule ^(.+)\.html$ http://yourdomain.com/wordpress/$1.php [R]
it however does work (hoorah!)
To test go here: http://coeleveld.com/imodrewrite
-
To jumpstart this topic:
(Am using SME 7.2 and PHP5/MySQL5)
Create a new ibay (I will use "wordpress" in this example).
db accounts setprop wordpress AllowOverride All
db accounts setprop wordpress FollowSymLinks enabled
signal-event ibay-modify wordpress
/etc/rc.d/init.d/httpd-e-smith restart
Restarting your webserver should not be necessary as this should be taken care of by the ibay-modify event.
The description might be good to post in the wiki in the Howto section but IMHO you really do not need .htaccess files on SME Server as you can modify the configuration template on a per ibay basis to include stuff like this.