Subfolder in localhost has broken links

Permalink
Hi - I've inherited a concrete5 website, and I am trying to clone it from the live server to a subfolder in my localhost - which is running MAMP.

The website's home page is loading - so the database connection is working - however, the links to the stylesheets and hyperlinks are broken. Their links are pointing to the root directory on the local server - not in the subfolder.

I installed a fresh copy of concrete5 on a separate subfolder - so it can't be the apache configuration on MAMP.

I'm guessing that I need to change some settings on my .htaccess file, which currently reads like this:

RewriteEngine On
RewriteBase /subfoldername/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]

Can any of you provide a solution so that the links point towards the correct directory?

 
exchangecore replied on at Permalink Reply
exchangecore
Clear the Cache via systems & settings in the dashboard and see if this helps.

Also you may need to modify your site config to tell it that you have a relative path. Add this line to /config/site.php

define('DIR_REL', 'subfoldername');
mattintouch replied on at Permalink Reply
Thanks for the reply. I cleared the website's cache, and added the recommended line to my config file.

The hrefs now display the correct location in the DOM - e.g.

href="subfolder/index.php/tools/css/themes/themename/a/css/nav.css"


however, the file that is requested is incorrect, e.g.

subfolder/subfolder/index.php/tools/css/themes/themename/a/css/nav.css


An additional directory has been added to the URL request.

What do you think is happening here?