Offline Server Info.
Windows xp sp3,
XAMPP for windows version 1.6.8
All config about mod rewrite has been setup properly.
Path installation: C:/xampp/htdocs/store/
URL root: http://localhost/store/
Added hosts configuration in C:\WINDOWS\system32\drivers\etc
127.0.0.1 www.mydomain.com
127.0.0.1 mydomain.com
Below is current htaccess on LIVE server that working perfectly (linux server), when I use following code in localhost and clicking on any links I get redirected to http://localhost/ instead of http://localhost/store/ , I don't have a problem viewing main url.
Then I modified my htaccess (help searching from google) like in AFTER EDIT but still have same problem.
CURRENT htaccess
- Code: Select all
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mydomain\.com$
RewriteRule (.*) http://www.mydomain.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} !^www\.mydomain\.com$
RewriteCond %{HTTP_HOST} ^.+\.mydomain\.com$
RewriteCond %{REQUEST_URI} !(images|membersdownload)$
RewriteCond %{REQUEST_FILENAME} !^/home/xxx/public_html/
RewriteRule ^(.*)$ %{HTTP_HOST}$1 [C]
RewriteRule ^(.*)\.mydomain\.com/.* /index.php?a=item&detail=$1 [QSA,L]
RewriteCond %{HTTP_HOST} ^([^\.]+)\.mydomain\.com$ [NC]
RewriteRule ^purchase /index.php?a=item&detail=%1&buy
RewriteCond %{HTTP_HOST} ^([^\.]+)\.mydomain\.com$ [NC]
RewriteRule ^images /index.php?a=item&detail=%1&img
RewriteCond %{HTTP_HOST} ^([^\.]+)\.mydomain\.com$ [NC]
RewriteRule ^seller /index.php?a=item&detail=%1&pub
RewriteCond %{HTTP_HOST} ^([^\.]+)\.mydomain\.com$ [NC]
RewriteRule ^membersdownload /index.php?a=item&detail=%1&dwn
RewriteCond %{HTTP_HOST} ^([^\.]+)\.mydomain\.com$ [NC]
RewriteRule ^usersreviews /index.php?a=item&detail=%1&rev
RewriteCond %{HTTP_HOST} ^([^\.]+)\.mydomain\.com$ [NC]
RewriteRule ^fraudreport /index.php?a=item&detail=%1&awr
RewriteCond %{HTTP_HOST} ^([^\.]+)\.mydomain\.com$ [NC]
RewriteRule ^usersreview-(.*) /index.php?a=item&detail=%1&usersreview=$1}
AFTER EDIT
- Code: Select all
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^localhost\.?(:[0-9]+)?$
RewriteCond %{HTTP_HOST} ^mydomain\.com$
RewriteRule (.*) http://www.mydomain.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} !^www\.mydomain\.com$
RewriteCond %{HTTP_HOST} ^.+\.mydomain\.com$
RewriteCond %{REQUEST_URI} !(images|membersdownload)$
RewriteCond %{REQUEST_FILENAME} !^C:/xampp/htdocs/store/
RewriteRule ^(.*)$ %{HTTP_HOST}$1 [C]
RewriteRule ^(.*)\.mydomain\.com/.* /index.php?a=item&detail=$1 [QSA,L]
RewriteCond %{HTTP_HOST} ^([^\.]+)\.mydomain\.com$ [NC]
RewriteRule ^purchase /index.php?a=item&detail=%1&buy
RewriteCond %{HTTP_HOST} ^([^\.]+)\.mydomain\.com$ [NC]
RewriteRule ^images /index.php?a=item&detail=%1&img
RewriteCond %{HTTP_HOST} ^([^\.]+)\.mydomain\.com$ [NC]
RewriteRule ^seller /index.php?a=item&detail=%1&pub
RewriteCond %{HTTP_HOST} ^([^\.]+)\.mydomain\.com$ [NC]
RewriteRule ^membersdownload /index.php?a=item&detail=%1&dwn
RewriteCond %{HTTP_HOST} ^([^\.]+)\.mydomain\.com$ [NC]
RewriteRule ^usersreviews /index.php?a=item&detail=%1&rev
RewriteCond %{HTTP_HOST} ^([^\.]+)\.mydomain\.com$ [NC]
RewriteRule ^fraudreport /index.php?a=item&detail=%1&awr
RewriteCond %{HTTP_HOST} ^([^\.]+)\.mydomain\.com$ [NC]
RewriteRule ^usersreview-(.*) /index.php?a=item&detail=%1&usersreview=$1}
Thanks.