URL Method

Register an Account
 
 
Article Tools Display Modes
  #1 (permalink)  
Old 09-03-2007, 06:35 PM
Yankidank's Avatar
Pligg Founder/Coder/Designer
Pligg Version: SVN
Pligg Template: Wistie
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 4,931
Send a message via AIM to Yankidank
Reserved for future use.

The Twitter Module for Pligg CMS!
Register, Login, and Submit Stories with Twitter. An absolute MUST HAVE for all Pligg sites!

Last edited by Yankidank; 09-03-2007 at 07:10 PM.
Reply With Quote
  #2  

URL Method

URL Method is the term used to describe the way a URL is formed. There are generally 2 types.
Method 1 = dynamic urls (default) and Method 2 = static urls
 

Contents

Dynamic vs Static urls


Dynamic urls contain variables and are typically seen on database driven sites like blogs and forums. A static url does not contain any variables and does not change. Static urls are easier for your users to read. They are also sometimes ranked higher by search engines.
Examples
Dynamic url: yoursite.com/pligg/story.php?title=storytitle
Static url: yoursite.com/pligg/news/yourstorytitle

Url Method options


There are three options on the Url Method page in the admin panel. Choose Url Method 2 to enable static urls.
  • Method 1 = dynamic urls (default)
  • Method 2 = static urls

.htaccess


If you enable Url Method 2 in the admin panel you should see static urls on your site but when you click on an internal link you'll probably get a 404 this page can not be found error. In order to work properly Url Method 2 requires modifications to your .htaccess file so that so that the new friendly urls are properly mapped to the actual files they refer to.
There is a default .htaccess file included in your Pligg installation called htaccess.default that contains a long list of rewrite commands that are meant to get you started. But you will probably need to modify this file in order to get static urls working properly on your site.



Step by Step Instructions

  1. Check with your host to see if mod rewrite is allowed. If not buy a dreamhost package to help pligg dev.
  2. Check with your host that Apache is configured to use .htaccess files (AllowOverride All)
  3. Get the latest htaccess.default from the SVN on sourceforge.
  4. Edit the file and make changes near the top if your Pligg site does not sit on the root of your domain. For example if you operate Pligg in a subdomain or subdirectory you will need to make edits. The file contains comments that direct you on where to make edits.
  5. Rename "htaccess.default" to ".htaccess" (no quotes). Note the period in front. That period denotes a hidden file, and may cause it to disappear from some FTP clients. (You might need to enable showing of hidden files or call it by name when downloading).
  6. Turn on URL Method 2 in the admin panel by going to Admin > Configure > SEO and set the URL Method to 2.

If your Pligg is installed in a subfolder


If Pligg is installed in a subfolder: (ie : yourdomain.com/pligg/) then you will need to modify the RewriteBase in .htaccess:
Change RewriteBase / to RewriteBase /pligg/

It's not working. How do I go back?


If this doesn't work, mod_rewrite probably isn't enabled on your webserver. You can go back to the admin panel and set Url Method to 1 again. No harm was done to any files during the instructions above and your site should operate fine without friendly urls.


Contributors: Yankidank, chuckroast, na3s
Created by Yankidank, 09-03-2007 at 06:35 PM
Last edited by Yankidank, 04-14-2011 at 02:31 PM
5 Comments , 13411 Views
 

Article Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
url method 2 advancement davebowker Questions and Comments 13 01-12-2012 01:12 PM
FIX for gzip compression troubles, no .htaccess gzip compression method required Daniel Questions and Comments 9 06-07-2010 09:06 AM
Using Search Method 4 - Tags will not work hotsitez Questions and Comments 11 11-29-2008 08:54 PM
Search Method 3 and 4 in Pligg version 9.8.2 broke Iceburg Questions and Comments 3 11-03-2007 08:03 PM
Sort news options on Published/Upcoming tabs do not support Voting Method 2 aaronpais Questions and Comments 2 05-19-2007 11:31 AM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development