Htaccess and Localhost

I am doing some work for a client on a redesign.

Downloaded all the files etc but getting trouble running the site locally with images and css etc…

All images are written in the files with this format:


In the htaccess then it has:

RewriteCond %{HTTP_HOST} ![1](
RewriteRule ^(.*)$$1 [R=301,L]

Ive tried changing the htaccess file to represent my local setup - http://localhost:8888/example
but none of images or css is displaying

Any ideas?

  1. IANA — Example domains ↩︎



Why would you encode the IANA – Example domains with PLEASE wrap your code in [noparse]


[/noparse] tags as that preserves the code when quoting for a reply.

RewriteCond %{HTTP_HOST} !^www[COLOR="Red"]\\[/COLOR].example[COLOR="Red"]\\[/COLOR].com [COLOR="Red"][NC][/COLOR]
RewriteRule .?{REQUEST_URI} [R=301,L]

It does the same thing, properly escapes the desired domain, ensures that it’s NOT case sensitive ({HTTP_HOST} is NOT case sensitive but mod_rewrite’s regex is!) and there is no need to capture the {REQUEST_URI} in another variable.

As shown in my signature’s tutorial (and in the sticky posts in this board), all that code does is force to be the domain in the location box of visiting browsers.