How to use .htaccess file inside the folder. I'm using two
.htaccess files in my hosting, one for labs.9lessons and another for
touch.9lessons. Just take a look at this post how I had implemented.
Original URL : http://www.9lessons.info/touch/index.php?id=srinivas
to
Friendly URL : http://touch.9lessons.info/srinivas
First .htaccess file
This code redirects sub domain http://touch.9lessons.info pointing to touch folder.
Second .htaccess file
This file inside the touch directory. Contains single parameter URL rewriting code.
Old Posts about .htaccess
Original URL : http://www.9lessons.info/touch/index.php?id=srinivas
to
Friendly URL : http://touch.9lessons.info/srinivas
First .htaccess file
This code redirects sub domain http://touch.9lessons.info pointing to touch folder.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^touch\.9lessons\.info$
RewriteCond %{REQUEST_URI} !^/touch/
RewriteRule (.*) /touch/$1
RewriteCond %{HTTP_HOST} ^touch\.9lessons\.info$
RewriteCond %{REQUEST_URI} !^/touch/
RewriteRule (.*) /touch/$1
Second .htaccess file
This file inside the touch directory. Contains single parameter URL rewriting code.
RewriteEngine On
RewriteBase /touch/
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?id=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?id=$1
RewriteBase /touch/
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?id=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?id=$1
Old Posts about .htaccess
- Redirect The Sub Domain To a Sub Folder with .htaccess
- URL Rewriting Tip with .htaccess File
- Pretty URLs with .htaccess Rewriting Tips.
- Add Security to your PHP projects using .htaccess file

Wow amazing information about PHP development. PHP is best programming for custom website design in easy way so speedy also. PHP Application Development Company provide total solution for PHP.
ReplyDelete