Improve the look of short URLs by removing index.php from it. For example you can convert short URLs like http://www.xaraya.com/index.php/article to
http://www.xaraya.com/article
You want URLs easier to read and more search engine friendly.
Removing index.php from the URL can be easely done by using a .htaccess file and by amending the Xaraya config file.
This method has been tested in apache webservers with mod_rewrite installed. IIS has url rewriting plugins, but I haven't test them yet.
Create a file called .htaccess in your xaraya root folder and put this text:
RewriteEngine onSave it, good!
Note: file must be uploaded as ASCII, and have permission 644
Open the file config.system.php stored in /var/ and change the last lines from:
//$systemConfiguration['BaseURI'] = '';to:
$systemConfiguration['BaseURI'] = '';If you have installed xaraya in a subfolder like http://localhost/foldername/, change the lines to:
$systemConfiguration['BaseURI'] = '/foldername';Note: If you followed the security instructions when you installed xaraya, you might have to set (CHMOD) write permission and change the owner (CHOWN) to yourself.
Save it, CHMOD the file to 444 (read only) and change owner (CHOWN).
Should be done!
Notes:
You should also be sure your apache httpd.conf file allows modrewrite overrides in the .htaccess. In your <Directory [webroot] > section, set "AllowOverride option" or "AllowOverride all"
When you have troubles and don't get the rewrite to work, try adding an extra '/', as has been done below:
RewriteRule ^(.+) /index.php/$1 [L]
A more advanced .htaccess is given below:
RewriteEngine On
# Here comes your base directory
RewriteBase /yourbasedir/toxaraya/
# Deny access from .htaccess
RewriteRule ^\.htaccess$ - [F]
# Missing favicon should not cause Xaraya to be loaded..
RewriteRule ^favicon\.ico - [L]
# Existing files shouldn't get rewritten
# but the rest can go to Xaraya
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+) index.php/$1 [L]
This one will add extra speed, as a missing favicon will not cause Xaraya to load.
Change the last line to the following if you run into a redirect loop (encountered when using multiform pages in the Xarpages module):
RewriteRule ^(.+) index.php/$1 [L,QSA]
Maintainer: Denis Last modified on Sep 14, 2008 4:58:09 AM by krzysz