Search code examples
phpapache.htaccessvagrantlamp

Apache links not being sent to correct port


I have vagrant up and running, forwarding port 80 -> 8080. The PHP project is being served if I navigate to localhost:8080. However, all the links are being to sent to localhost, which doesn't work since my local machine isn't serving the project. I need the link to be localhost:8080/xxxxxx.

I believe I need to add a rule to .htaccess, but I'm not exactly sure what I need to add. Any help would be appreciated, and if I should move this to serverfault or superuser please let me know.


Solution

  • Edit your /sites/default/settings.php Drupal file, and change the $base_url variable to:

    $base_url = 'http://localhost:8080'; // NO trailing slash!