Go Back   Pligg Forum > Pligg Help > Wiki Articles
 
 
LinkBack Article Tools Display Modes
  #1 (permalink)  
Old 09-03-2007, 03:18 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,347
Downloads: 58
Uploads: 6
Thanks: 87
Thanked 139 Times in 93 Posts
Htaccess

Reserved for future use.
__________________
Need a Pligg Host?
Get 3 free months
when you buy a year of hosting.
Use the coupon PLIGG 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:15 PM.
Reply With Quote
Sponsored Links
Check out the New Modules at the Pligg Pro Shop.
  #2  

Htaccess

This is just going to be a small tutorial on how to use an .htaccess file with Pligg and what it can do for your Pligg site.
  1. There is no support for .htaccess on windows servers e.g. IIS. This has to do with how Windows servers work and is not an issue with Pligg. This tutorial will be biased towards Apache since that's what most people use.
  2. Make sure that mod_rewrite is enabled in Apache. If you have access to your Apache httpd.conf file search for LoadModule rewrite_module modules/mod_rewrite.so and make sure there isn't a # in front of it. If there is, remove it and save the file. You will need to restart Apache for this to take effect. If you follow this tutorial and get an error that says "Internal Server Error" or something similar that usually means that mod_rewrite is not enabled.
  3. Next rename your htaccess.default file to .htaccess (Note the period in front of it)
  4. Now I am going to go through the important things in the .htaccess file that you need to know about
    • RewriteBase /
      This tells the .htaccess file where your Pligg is installed. If it's installed in the root of your server then you don't need to change this line. If you installed Pligg in a subfolder called pligg then you will want to change it to RewriteBase /pligg
    • RewriteCond %{HTTP_HOST} !^www.
      RewriteRule ^/?(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

      This section of code will automatically put www. in front of your URL when someone visits your site. Most of the time this will fix the problem people run in to when voting won't work unless www. is used in the URL. This code should be removed if you do no want www. automatically appended to the URL.
    • RewriteRule ^(all|pligg)/([a-zA-Z0-9-]+)/?$ story.php?title=$2 [L]
      RewriteRule ^(all|pligg)/?$ ?category=$1 [L]

      You will notice these two lines in your .htaccess file. These are very important once you start adding categories to your Pligg site. Once you are in the category manager you will notice that it automatically produces the code you need for your categories to work with the .htaccess file. You will copy that code over the code above.
The rest of the htaccess file is for the use of URL method 2 or "clean" urls. For example: www.mydomain.com/search.php?search=technology would change to www.mydomain.com/search/technology


Pligg beta 9 has quite a few bugs when it comes to using "clean" urls but they have since been fixed and if you would like to have this working on your site here is a quick tutorial on how to get the latest SVN code: http://www.pligg.com/forum/showpost....92&postcount=2


Here is the article on wikipedia about htaccess .htaccess - Wikipedia, the free encyclopedia


Contributors:
Created by Yankidank, 09-03-2007 at 03:18 PM
Last edited by Yankidank, 09-03-2007 at 05:15 PM
1 Comments , 1146 Views
 



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
htaccess problem! ecommerce General Help 0 06-30-2007 05:14 PM
Voting doesnt work how to do i edit the htaccess file? hitboy General Help 0 06-18-2007 04:24 AM
Category htaccess mod rewrite output ordering mspainhower Bug Report 2 05-13-2007 05:56 PM
Closed user group - htaccess tbones General Help 5 05-04-2007 01:30 AM
[Fixed] problem adding gzip code in htaccess zearth Bug Report 15 02-12-2007 07:27 AM


LinkBacks Enabled by vBSEO 3.0.0