views:

20

answers:

0

I think I'm missing something and don't think I really understand how rewriteBase works.

The problem I have is that I have a production site where the site is in the root directory yet I have my development site in a localhost subdirectory. Eg http://www.sitename.com/ vs http://localhost/sitename/

If I have for example an images folder I want to reference the images from the site root by using the initial slash in the href. Eg Using a relative href (without the initial slash) is not an option. This will work on the production site but the development site is looking for http://localhost/images/imagename.jpg instead of http://localhost/sitename/images/imagename.jpg

So I thought all I needed to do was setup the following in my .htaccess file to force the site root to my subdomain within the development environment:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /sitename

But this still uses localhost as the site root instead of localhost/sitename.

Can anyone please give me some pointers?

-------------------------EDIT---------------------------

I stopped trying to do this in the .htaccess file and tried to just use the html command but this also didn't work.

In the end I set up Virtual Hosts in Apache on the local server but it seems like such an awful lot of overkill to just change the site root. I'm also concerned that other developers on the LAN network won't be able to access the site properly via the virtual host.

I'm really needing some 'best practice' advice please on setting up a workable development environment in WAMP.