How to use .htaccess file inside the folder. I'm using two .htaccess files in example hosting, one for labs.example and another for touch.example. Just take a look at this post how I had implemented.
Original URL : http://www.example.com/index.php?id=parthivto
Friendly URL : http://touch.example.com/parthiv
First .htaccess file
This code redirects sub domain http://touch.example.com pointing to touch folder.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^touch\.example\.com$
RewriteCond %{REQUEST_URI} !^/touch/
RewriteRule (.*) /touch/$1
RewriteCond %{HTTP_HOST} ^touch\.example\.com$
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
Parthiv Patel
Bhaishri Info Solution
Sr. PHP Developer
Limdi Chowk, AT PO. Nar, Di. Anand
Nar, Gujarat
388150
India
pparthiv2412@gmail.com
7383343029
DOB: 12/24/1986
No comments:
Post a Comment