-1

Summary
I have 2 servers, 1 Production & 1 Development

Problem
I want to keep the servers URLS the same in the code. The production server will be blah.com but I want the development server to be dev.blah.com. The hard coded urls on both the sites are blah.com.

So when accessing dev.blah.com how would I be able to use Apache to keep me on this site without redirecting to blah.com? Am I looking at this correctly or is there something else I should be doing?

Robert
  • 207
  • 1
  • 6

1 Answers1

2

If your site sends out URLs from blah.com and you click on your browser on those URLs, your browser will send you to blah.com and there's nothing you can rewrite to avoid that.

The solution for this issue is to make the base URL configurable for your site or just use relative paths in the URLs (i.e use /section/ instead of http://blah.com/section/.

GomoX
  • 776
  • 3
  • 8
  • 21
  • You can technically have the site in blah.com check the referrer and redirect to dev.blah.com if you came from there, but that will probably break a lot of things if you site isn't strictly static. – GomoX Jan 10 '14 at 16:33