Code solutions to PHP, JS, CSSCode source PHP, JS, CSS

Spread your code soluces to the world

Love me
Solucior » HTACCESS » Create virtual folders using htaccess

Create virtual folders using htaccess

05/19/2011 by Dux   -   1.8/5 (4 ratings)

These 3 lines of code for .htaccess create virtual folders. An URL like www.mywebsite.com/virtual_folder/home.html will be understood by the server as www.mywebsite.com/index.php?dir=virtual_folder&page=home

source code



 
RewriteEngine on

# display the directory
RewriteRule ^([a-zA-Z0-9_-]+)/$ /index.php?dir=$1 [L]

# display a page
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+).html$ /index.php?dir=$1&page=$2 [L]
Rate this code     |     Copied : 69x

Comments for Create virtual folders using htaccess

pravina     09/29/2011 11:50
please  explain about .htaccess
Add a comment Nickname
ZOOM


Create virtual folders using htaccess
Extract links from a page
Extract images from a page
PHP watermark
Isolate a color
Adjust the rate of image colors
Simple method : listing files from a directory
Dynamically add rows to a form. Complete solution
Automatically adjust brightness contrast of an image
Simple image gallery PHP