-
Book Overview & Buying
-
Table Of Contents
CouchDB and PHP Web Development Beginner's Guide
By :
In order for us to handle all requests to a directory, we'll create a .htaccess file in the working directory.
1. Create a file called .htaccess in the working directory.
2. Add the following code to the file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?request=$1 [QSA,L]
</IfModule>
3. Open the file index.php in the working directory.
4. Change the code inside of index.php to match the following:
<?php echo $_GET['request']; ?>
5. Open your browser, go to http://localhost/verge/test/abc, and go to http://localhost/verge/test/123. Notice that the page will respond back to you with the same value that you entered at the end of the root URL.

We first created a .htaccess file to enable us to do URL rewriting. The first line,<IfModule mod_rewrite.c>, checks to make sure that we enabled the mod_rewrite module...
Change the font size
Change margin width
Change background colour