[newbie] Making sense of a .htaccess

This is a discussion on [newbie] Making sense of a .htaccess within the Apache Web Server forums, part of the Web Server and Related Forums category; Hello When working on my laptop, I'd like to use a lighter alternative to Apache that is Abyss X1 ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-25-2007
Vincent Delporte
 
Posts: n/a
Default [newbie] Making sense of a .htaccess

Hello

When working on my laptop, I'd like to use a lighter alternative to
Apache that is Abyss X1 to write web apps using the Code Igniter PHP
framework. Problem is, to present clean URLs, Code Igniter uses
mod_rewrite and .htaccess... which Abyss doesn't support.

I googled for information on mod_rewrite, but I'm stuck with the
second condition below :-/

So I need to understand what the .htaccess sample given in the Code
Igniter documentation means before trying to rewrite it to work with
Abyss' URL Rewriting module.

Here's the .htaccess that works when I upload the app on a shared host
that runs Apache:

----------
RewriteEngine on
RewriteRule ^$ index.php [L]
RewriteCond $1 !^(index\.php|assets|search)
RewriteRule ^(.*)$ index.php/$1 [L]
----------

1. Does the first line mean that if the URL is empty for that part of
the URL (eg. http://localhost/igniter/), it should append index.php
(to turn into http://localhost/igniter/index.php)?

2. In the RewriteCond line, what does $1 stand for? I haven't found
information on this type of variable. Is it somehow related to a $1
reference in regexes?

Thanks!
  #2 (permalink)  
Old 01-26-2007
Vincent Delporte
 
Posts: n/a
Default Re: [newbie] Making sense of a .htaccess

On Thu, 25 Jan 2007 08:58:47 +0100, Davide Bianchi
<davideyeahsure@onlyforfun.net> wrote:
>> 2. In the RewriteCond line, what does $1 stand for?

>
>The bits in the parenthesis in the url, so basically the whole URL.


OK. So Apache first saves the stuff between brackets into $1, and then
performs the test.

Thanks!
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:04 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0