Hello! I am running the .htaccess file online on the server - no problems there ... My problem is when I try to run it on localhost ... nothing ... PHP code/MySQL everything else is great Here's a sample of the server version .htaccess file ... Options +FollowSymLinks rewriteEngine on rewriteBase / RewriteCond %{HTTP_HOST} ^h**p://www.somethingseomething.com/ RewriteRule ^(.*)\.htm$ /view-this.php?UID=$1 [L] ... etc ... this works great on the server ... on the localhost, I changed RewriteCond %{HTTP_HOST} ^h**p://www.somethingseomething.com/ to RewriteCond %{HTTP_HOST} ^h**p://localhost/something nothing ... I'm using Sokkit (should really not make a difference), PHP, etc ... any ideas - thanks greatly!
I think that localhost can actually get translated into different values of HTTP_HOST - the local IP address, the machine name if you have one assigned, etc. Try not specifying the host, as you know its going to be localhost on your machine, right? You could maybe try RewriteCond %{HTTP_HOST} ^.*$and see if that works. Hope it helps John
whats you localhost? Sure you run apache? RewriteCond %{HTTP_HOST} ^h**p://something should work Expat
Hi !! Initially I had the same problem when I started working on .htaccess. I found that it never works in localhost, so I assumed may be .htaccess is does not work in localhost. Later I got to know that when you are working with .htaccess, you need to check whether the rewrite engine is on or off. It should be on. I fit still does not work then check your .htaccess code syntax. That must be wrong somewhere, even a very very small error also does create the same problem. So, let me know if i could help you or not. feel free to contact with me http colon) slash slash (//) www dot webglobesolutions dot net slash(/) contact-us slash(/)
Hi! I have the same problem, I know what can be the problem is , but I dont know how to solve it. The problem is that I use for css relative link and in .htaccess I use RewriteCond %{REQUEST_URI} !\.(css|gif|ico|jpg|js|png|swf|txt)$ for it. That's working for me...but in localhost I use wamp server and the absolute path is localhost/mysite/index.php...When I put css folder into the root folder(WAMP server root folder is called WWW) it's working fine WWW directory .. mysite --css index.php css
I solved my css file have a relative link css/style.css I use this condition in .htaccess: RewriteCond %{REQUEST_URI} !\.(css|gif|ico|jpg|js|png|swf|txt)$ The solution: In remote host I use in HEAD section base href http://www.mysite.com/ and in localhost I use http://localhost/mysite/ and I put it as a variable into my config.php file