Location: PHPKode > projects > Chirp: The Microblog > chirp.v.1.1/docs/doc.01.htaccess.txt
The .htaccess file controls how the links are handled on your site.  You

must edit this file in order for Chirp to work properly.  The .htaccess

file turns http://www.yoursite.com/index.php?act=something&loc=something2 

to http://www.yoursite.com/something/something2



Without the .htaccess file the script would fail.  There are four sections

we need to enter into the .htaccess file. They are as follows:



Options +FollowSymLinks 



<IfModule mod_rewrite.c>

	RewriteEngine on

	RewriteBase /demos/chirp/

	RewriteRule ^profile\.php$ - [L]  

	RewriteCond %{SCRIPT_FILENAME} !-d  

	RewriteCond %{SCRIPT_FILENAME} !-f  

	RewriteRule ^@/(.*)$ ./profile.php?id=$1 [L]

</IfModule>



<IfModule mod_rewrite.c>

	RewriteEngine on

	RewriteBase /demos/chirp/

	RewriteRule ^users\.php$ - [L]  

	RewriteCond %{SCRIPT_FILENAME} !-d  

	RewriteCond %{SCRIPT_FILENAME} !-f  

	RewriteRule ^users/(.*)$ ./users.php?id=$1&act=$2 [L]

</IfModule>



<IfModule mod_rewrite.c>

	RewriteEngine On  

	RewriteBase /demos/chirp/

	RewriteRule ^index\.php$ - [L]  

	RewriteCond %{SCRIPT_FILENAME} !-d  

	RewriteCond %{SCRIPT_FILENAME} !-f  

	RewriteRule ^(.*)$ ./index.php?loc=$1 [L]

</IfModule>



The first line tells incoming traffic to follow the links as symbolic and do

not show the true link. 



The 2nd entry is for the profile so when you click on the name @groone

You will go to http://www.yoursite.com/@/groone which is really

profile.php?id=username



The 3rd entry is for the user area. and the 4th is for the main area that

everyone has access to.



WHAT TO EDIT?

Do you see the line RewriteBase /demos/chirp/ ? You need to edit this so it matches your

site of where chirp is installed.  It is relative to http://www.yoursite.com/ so if you

installed the script at the root of your site you would simply put in / but if you installed

at http://www.yoursite.com/gab/ you would put in /gab/ this needs to be done on all 3 entries.



I'm not the best with mod-rewrite or .htaccess so if you know of a better way let me know.



Lastly, htaccess is spelled like  .htaccess and yes, that is a period in front of it.  This

file cannot be edited very easily with notepad but can be edited with a great editor called

notepad++.  It's a free editor that can be downloaded from here http://notepad-plus-plus.org/



I do a large bit of my programming and text editing with this editor.  As a matter of fact

I am typing this install tutorial with it right now.



If you need further help with editing .htaccess then hit up the forums on http://groonesworld.com



Return current item: Chirp: The Microblog