.htaccess code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ChrisBull
Forum Commoner
Posts: 42
Joined: Fri Aug 20, 2010 7:43 am

.htaccess code

Post by ChrisBull »

Hi, I am trying to get all of the urls to go to the home page, index.php so i am using a .htaccess file. I don't really ubderstand any of the turorials that i have found though and so can't get it to work.

This is what i have so far.

Code: Select all

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^bandsite/ [NC]
RewriteRule ^(.*)$ http://bandsite/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
The idea is that it will force the 'http' bit to every url for consistency and all the urls got to index.php
I wrote it a long time ago, and now i don't know what it does.
Could someone please explain the code to me.

Thank you for you time
Chris
Post Reply