t

hiding index.php using htaccess- looping redirect

0

Posted by admin | Posted in Blog | Posted on 10-05-2009

A client recently had a problem with a website that they had moved from one server to another.. both were cpanel hosted servers and looked to be similar configuration. The issue he faced was that the .htaccess file he used before now caused infinite loops when going to the main page. The .htaccess file was being used to try and hide the index.php filename from the URL. The reason this was done was to make a more friendly URL and to stop anyone realising that there was a global index.php in the root that checked authentication etc..

The effect was that the URL http://www.domainname.com/index.php/applicationpage could be represented as http://www.domainname.com/applicationpage

The loop did not really make sense, my initial thoughts were towards permissions, but that path quickly lead no-where. Doing a Google search for “.htaccess file causing infinite loop” returned a huge number of results, most of which did not apply to what we were trying to achieve. Eventually I got more specific with the search and started searching for results that also included server configuration issues/solutions. Eventually I stumbled across this page:

http://expressionengine.com/wiki/Remove_index.php_From_URLs/

Which explained that some servers required an extra question mark in their .htaccess RewriteRule… so that rather than reading..
RewriteRule ^(.*)$ /index.php/$1 [L]
we added a ? after the index.php to read
RewriteRule ^(.*)$ /index.php?/$1 [L]

Voila, the solution worked perfectly, ending hours of frustration for both me and the client 🙂

The ending .htaccess file read

RewriteEngine On
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]

iiNet Asterisk/Trixbox configuration – Outbound not working

4

Posted by Cameron | Posted in Blog | Posted on 08-05-2009

After months (on and off) of attempting to get a Asterisk 1.5 or Trixbox 2.6 installation working in both directions… with earlier versions of asterisk my existing config would ring out but not in.. with the migration to version 1.5, I could ring in, but not out.. It was extremely frustrating..

I finally cracked it.. Below is a example of my working iiNet SIP trunk config.. Hope it helps someone as much as it would have helped me ages ago!

*******************************************
General Settings

Outbound Caller ID: 089XXXXXXX

Dial rules:
000
0011.
04XXXXXXXX
13XX.
6XXXXXXX
9XXXXXXX

(yes I know some STD rules are missing)

******************************************
Outgoing Settings

Trunk name: iinettrunk

disallow=all
allow=alaw&ulaw
canreinvite=no
context=from-trunk
fromdomain=iinetphone.iinet.net.au
host=sip.<YOURSTATE>.iinet.net.au
insecure=very
dtmfmode=auto
nat=yes
pedantic=no
secret=<password>
type=friend
registersip=yes
username=089XXXXXX

*******************************************
Incoming Trunk

canreinvite=no
context=from-trunk
fromuser=089XXXXXXX
insecure=very
secret=<password>
type=friend
username=089XXXXXXX
qualify=yes
nat=no

*****************************************

Register string (all on one line – no spaces)

:<password>:089XXXXXXX@iinettrunk/089XXXXXXX

****************************************************

This config has been tested by me 3 times now, in virtual servers and physical ones, over various connections (even mobile broadband connections).. it works perfectly both directions (so long as your other config is OK)

Thanks

booo

wp_pagenavi();