Welcome Guest ( Log In | Register )


> IPS Related Information

This section is focused on Invision Power Services products...

IPS, widely praised for the continuous efforts aimed to a stable, fast and efficient board system has brought to us Invision Power Board, but not only that..

Invision Power Gallery & Invision Community Blog allow the forum members :

  1. Host & publish images
  2. Host and link Blogs
  3. Integrate all that to the Invision Power Board

 
Reply to this topicStart new topic
> IPS Tutorials: Tips and Tricks > Enabling friendly URLs
RSS Bot
post 15 May 2009, 04:17 PM
Post #1


yourforum Robot
Group Icon

Group: Private Members
Posts: 196639
Joined: 12-July 05
From: RSS World
Member No.: 125



IP.Board 3.x supports friendly URLs. The friendly url support can operate in a couple different ways, depending upon your server environment and configuration.

Enabling friendly urls
To enable friendly urls, you will need to download the conf_global.php file from your forum root directory, and add the following line

$INFO['use_friendly_urls'] = 1;


If you already have a line that has the key "use_friendly_urls" and the value is set to 0, change it to a 1 as in the code box above.

Configurable options for friendly urls
There are a couple of ACP-configurable settings that will affect friendly urls which you should be aware of. These settings are under the "Server Environment" setting group.

  • Redirect to new friendly URL format?: The old showtopic=##, showuser=##, etc. style links will be redirected to the new friendly urls.
  • Use "301" for friendly URL redirects?: IPB will send a 301 header when the user is redirected to the new friendly url
  • URL Type: This setting only matters if you are not using .htaccess to rewrite the URLs. "Path Info" will make the friendly urls utilize "/index.php/" in them like so:

    http://yoursite.com/forums/index.php/topics/123-topic


    "Query string" will utilize "/index.php?/" in them like so

    http://yoursite.com/forums/index.php?/topics/123-topic


    This is a minor detail of course, but some servers are only able to read the query string method above, so if "path info" does not work for you, try "query string" instead. Of course, as stated previously, if you are using .htaccess url rewriting, this setting is irrelevant.
  • Use .htaccess mod_rewrite: This will remove the "index.php/" from the URL entirely so that the URL looks like so

    http://yoursite.com/forums/topics/123-topic


    You must be using a server that has Apache installed with the mod_rewrite module, and you must upload a .htaccess file to your forum directory with the code provided in the setting description (this code is generated dynamically based on your configured url). If you are using another server environment that has native url-rewriting capabilities, you can enable this setting so long as you add a configuration file that tells your server to route all requests for files/folders that do not exist through index.php for processing. It is up to you to create the necessary configurations for other server environments such lighttpd or nginx, however.
  • Incorrect Permalink Handling: This setting specifies how to handle requests for the wrong friendly url. For instance if the url should be "/1234-topictitle" but a user requests "/1234-othertopictitle", IPB can optionally do nothing (load the page anyways), add a meta tag to the page to tell robots not to index the page, or redirect the user to the correct version of the page. It should be noted that if you opt to redirect the user to the correct version of the page, and there are many such links on your site, this will increase the resource usage on the server. In this instance, IPB has to load all of the topic libraries and data before it can verify the friendly url is correct, and then when it redirects the user it must do the same again, in effect doubling the processing when incorrect urls are requested. If performance is a concern, you should avoid setting IPB to redirect the user to the correct permalink.


Configuring the friendly url formats
Applications that support friendly urls will have a furlTemplates.php file in their extensions/ folder. For instance, to change the format of the forum friendly urls you would need to edit /admin/applications/forums/extensions/furlTemplates.php. Each application can contain it's own furlTemplates.php, so you should repeat this process for each application you wish to change.

Afterwards, you will need to login to your ACP, visit the Manage Applications & Modules page under the System tab, and click the button "Rebuild FURL Cache". A file is cached to the /cache/ folder with the friendly url templates for all applications for performance reasons, so you must be sure to update this cache after changing the format of any of the templates. View the full article
Go to the top of the page
 
Bookmark this: Post to Del.icio.usPost to DiggPost to FacebookPost to GooglePost to SlashdotPost to StumbleUponPost to TechnoratiPost to YahooMyWeb
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 19th April 2024 - 08:06 AM
Skin and Graphics by Dan Ellis and Anubis. Hosting by Forums & More © 2005-2011.
InvisionGames - Your #1 Arcade Games Repository | AllSigs - Signatures for all | Rock Band + Guitar Hero = RockHero ! | The Remoters - Remote Assistance | FileMiners - You ask, We find