Short URLs & Rewrite Rules
In order to enable short URL's with phpFox2 you will need mod_rewrite, most servers today have support for this. To enable this feature open the file on your server:
htaccess.txt
Look for:
RewriteBase /If you have installed phpFox2 in a sub-folder you will need to change the trailing slash with the sub-folder path. For example if you installed your site on:
http://www.yoursite.com/folder/
You will need to change the RewriteBase to:
RewriteBase /folder/If you installed your phpFox2 in your sites root directory (eg. http://www.yoursite.com ) you can leave this setting as it is.
Next lets rename the file
htaccess.txt
to
.htaccess
Once you have done that open the file
/include/setting/server.sett.php
and look for
$_CONF['core.url_rewrite'] = '2';
and replace that with
$_CONF['core.url_rewrite'] = '1';
By setting this to "1" this will transform your sites URLs from:
http://www.yoursite.com/index.php?do=/blog/title/
to
http://www.yoursite.com/blog/title/
Save and close the file. You should now have short url's enabled on your site.
Sub-Domain Short URLs (Beta)
We are currently testing rewriting URLs with wildcard sub-domains. In order to use this feature your server must support wildcard sub-domains. With this setup each of your users will have their own sub-domain. For example if we had a users profile using the short URL method like:
http://www.yoursite.com/username/
with this setup it would be:
http://username.yoursite.com/
Earlier we used a link to display how a blog would look with short URLs like:
http://www.yoursite.com/blog/title/
with this setup it would be:
http://blog.yoursite.com/title/
In order to set this up (assuming you have already followed the instructions above to install short URLs) open the file:
include/setting/server.sett.php
look for:
$_CONF['core.url_rewrite'] = '1';
replace with:
$_CONF['core.url_rewrite'] = '3';
Next, open the file:
.htaccess
Look for:
RewriteBase /
Under that add:
RewriteCond %{HTTP_HOST} ^admincp.example.com$ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*) index.php?do=/$1
Notice where we have:
example.com
Change that to your host name. Note this is not the full path to where your site is installed, this is just your host name.
In some environments you may need to add the sections as subdomains, if this does not work out of the box please consult with your hosting company.

If you are getting a 404 error you might have accidentally put in "folder" in the .htaccess file and not the actual folder name.
Have the same issue as everyone else. Added RewriteBase / to the .htaccess file and changed 2 to 1. Menu links went to correct url (http://site.com/blog) but every page returned a 404 error. Has anyone solved this issue?
I did follow the example above for the first step to try and eliminate the "/index.php?do=/user/" portion of the URL but I too had broken links. It worked fine when changing the number from 2 to 1 I could see the URL's were correct but they were also broken. I have the site installed on my root directory so I only renamed the htaccess file (eliminating the .txt). I could not get it to work so I changed it back so the site would work. Any ideas?
NumarkJanjan... You really don't need to follow the instruction word for word. The mistake is when you cut and paste this line:
RewriteBase /folder/
if you're not using a folder, keep it as is.
RewriteBase /
This will cause problems if you did change it.
I followed the Short URLs & Rewrite Rules for phpfox2 word for word and now I got the following warning message in the AdminCP...
"Main configuration file (include/setting/server.sett.php) is writable. This is a security risk and this file should not have any "write" permission".
When I now try to modify the include/setting/server.sett.php file so it has no "write" permissions, it is not saving the "read" only permissions and keeps automatically switching back to include "write" permissions.
Anyone know what I can do to correct this asap?
Hi, I've got the same thing. Ive got a 404 not found error, when my server has the Wildcard installed.








