Go Back   Pligg Forum > Pligg Help > Wiki Articles
 
 
LinkBack (1) Article Tools Display Modes
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 09-03-2007, 04:35 PM
Yankidank's Avatar
Yankidank Yankidank is offline
Send a message via AIM to Yankidank Send a message via Skype™ to Yankidank
Pligg Founder
Pligg Version: 9.8.2
Pligg Template: Blue Green Stripes
 
Join Date: Dec 2005
Location: Savannah, GA
Posts: 1,316
Downloads: 57
Uploads: 6
Thanks: 87
Thanked 137 Times in 92 Posts
URL Method

Reserved for future use.
__________________
Need a Pligg Host?
Get 3 free months
and a free domain for life.
Use the coupon GOTAPEX-ROX-01 at either...
MidPhase hosting starting at $7.95/month.
ANhosting hosting starting as low as $4.95/month.

Last edited by Yankidank : 09-03-2007 at 05:10 PM.
Reply With Quote
The Following User Says Thank You to Yankidank For This Useful Post:
Sponsored Links
Check out the New Modules at the Pligg Pro Shop.
  #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. Go to your admin panel/category management. At the bottom there is a rewrite rule for the categories. Copy this whole line and in htaccess.default paste over You need to copy the line for this whole thing to work right. Paste over the line: RewriteRule ^(all|pligg|category1|category2)/([a-zA-Z0-9-]+)/?$ story.php?title=$2 [L]
  5. Upload htaccess.default to your webserver in the root directory of your install. Overwrite the existing one.
  6. 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).
  7. Turn on URL Method 2 in the admin panel.
  8. Enjoy friendly URL's

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/

Rewrite rule for categories


Every time you add a new category to your site you need to update the mod rewrite rules for the category urls. Simply go back to the admin panel / category management page copy the new rewrite rule and paste it on top of the old one in your .htaccess file.

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: na3s, chuckroast
Created by Yankidank, 09-03-2007 at 04:35 PM
Last edited by na3s, 05-04-2008 at 01:34 AM
4 Comments , 2916 Views
 


LinkBacks (?)
LinkBack to this Thread: http://forums.pligg.com/wiki-articles/8594-url-method.html
Posted By For Type Date
5 Easy Ways to Make Sphinn SE Friendly » SEM.co.nz This thread Pingback 11-14-2007 03:09 AM

Article Tools
Display Modes
Posting Rules
You may not create new articles
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
Has anyone got Friendly Urls (Url Method 2) working? revolver General Help 11 05-07-2008 11:32 PM
Sort news options on Published/Upcoming tabs do not support Voting Method 2 aaronpais Pligg Mods 2 05-19-2007 09:31 AM
Help with URl method 2 dollars5 General Help 9 04-17-2007 09:16 AM
FIX for gzip compression troubles, no .htaccess gzip compression method required Daniel Core Development 8 02-16-2007 02:16 PM
url method 2 advancement davebowker General Help 10 02-11-2007 04:45 PM


LinkBacks Enabled by vBSEO 3.0.0