Short URL’s with phpFox and Apache Mod_ReWrite

>>> First be sure that Apache via httpd.conf file support Mod_ReWrite

Enable mod_rewriteFind the httpd.conf file (usually you will find it in a folder called conf, config or something along those lines)

Inside the httpd.conf file uncomment the line LoadModule rewrite_module modules/mod_rewrite.so (remove the pound ‘#’ sign from in front of the line)

Also find the line ClearModuleList is uncommented then find and make sure that the line AddModule mod_rewrite.c is not commented out.

>>> Now you are ready to make phpfox use short URL

*** First build a .htaaccess file and put it in your home directory

If your site is off the home director of your site, then remove portal

In this example , the site was installed on a sub directory portal

RewriteCond %{REQUEST_URI} !^/portal/file/.*
RewriteCond %{REQUEST_URI} !^/portal/install/.*
RewriteCond %{REQUEST_URI} !^/portal/update/.*
RewriteCond %{REQUEST_URI} !^/portal/design/.*
RewriteCond %{REQUEST_URI} !^/portal/plugins/.*
RewriteCond %{REQUEST_URI} !^/portal/site/.*
RewriteCond %{REQUEST_URI} !^/portal/include/.*
RewriteRule ^index.php(/.*)$ /portal/index.php?do=$1 [L]

RewriteCond %{REQUEST_URI} !^/portal/file/.*
RewriteCond %{REQUEST_URI} !^/portal/install/.*
RewriteCond %{REQUEST_URI} !^/portal/update/.*
RewriteCond %{REQUEST_URI} !^/portal/design/.*
RewriteCond %{REQUEST_URI} !^/portal/plugins/.*
RewriteCond %{REQUEST_URI} !^/portal/site/.*
RewriteCond %{REQUEST_URI} !^/portal/include/.*
RewriteCond %{REQUEST_URI} !^/portal/index.php
RewriteRule ^(.*)$ /portal/index.php?do=/$1 [L]

*** Then update your conf file for phpfox ( example of 1.6 build )

1. go to to include/settings/ and find server.sett.php
2. open this file up ini your favorite text editor

$_CONF['rewrite_engine'] = true;
$_CONF['path_translated'] = true;

*** Now your site can use “short urls”

Cheers,

-DS

Leave a Reply

You must be logged in to post a comment.