Article | Discussion | View source | History

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.