# Formatting broken on localhost when set as Relative to DOCROOT

**URL:** <https://forums.realmacsoftware.com/t/formatting-broken-on-localhost-when-set-as-relative-to-docroot/1916>\
**Category:** RapidWeaver Classic\
**Created:** [August 27, 2015, 8:17am UTC](https://forums.realmacsoftware.com/t/formatting-broken-on-localhost-when-set-as-relative-to-docroot/1916 "2015-08-27T08:17:29Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashleykaryl](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/ashleykaryl/32/4202_2.png) [@ashleykaryl](https://forums.realmacsoftware.com/u/ashleykaryl)\
**Post date:** [August 27, 2015, 8:17am UTC](https://forums.realmacsoftware.com/t/formatting-broken-on-localhost-when-set-as-relative-to-docroot/1916/1 "2015-08-27T08:17:29Z")

</div>

My site was initially set up as relative to Page and I was able to view sites on the localhost using MAMP but after changing to relative to DOCROOT the formatting automatically appeared broken on the localhost. It was fine in preview and fine on the actual server.

I thought this was a bug in MAMP, so last night I tried AMPPS and found exactly the same issue. I contacted their support forum to ask if there was a fix and they seem to think it’s a bug in Rapidweaver.

Is there a solution here?

 ![](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/1X/6b76f7a2253a2f37d5377582eb25233166c7047d.jpg) 

 ![](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/1X/5be1703083970bb55973513c7d1989bcf85e59ed.jpg)

---

<div class="post-metadata">

**Author:** ![nikf](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/nikf/32/10_2.png) [@nikf](https://forums.realmacsoftware.com/u/nikf)\
**Post date:** [August 27, 2015, 8:23am UTC](https://forums.realmacsoftware.com/t/formatting-broken-on-localhost-when-set-as-relative-to-docroot/1916/2 "2015-08-27T08:23:56Z")

</div>

> They seem to think it’s a bug in RapidWeaver

Could you elaborate on why that is suggested, at all? I’d _guess_ that if `/rw_common` isn’t processed by Safari / MAMP correctly, it’s looking for things at the root of your Mac instead of at the root of the export folder. RW doesn’t handle this - the easiest way to see if this is the case would be to use the Web Inspector to see why the assets aren’t loading. If the paths are correct, have you definitely exported the full site?

—Nik

---

<div class="post-metadata">

**Author:** ![ashleykaryl](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/ashleykaryl/32/4202_2.png) [@ashleykaryl](https://forums.realmacsoftware.com/u/ashleykaryl)\
**Post date:** [August 27, 2015, 8:28am UTC](https://forums.realmacsoftware.com/t/formatting-broken-on-localhost-when-set-as-relative-to-docroot/1916/3 "2015-08-27T08:28:17Z")

</div>

They simply said “It seems that this is RapidWeaver related issue. Please let us know if you need any further information.”

I am seeing this in all web browsers and not just Safari. Yes the full site has definitely been exported. Looking at the formatting here I did wonder if this may be related to SSL. It’s the same problem whether I use MAMP or AMPPS and it goes away if I set RW as relative to Page. I have verified this with more than one RW site.

---

<div class="post-metadata">

**Author:** ![nikf](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/nikf/32/10_2.png) [@nikf](https://forums.realmacsoftware.com/u/nikf)\
**Post date:** [August 27, 2015, 8:29am UTC](https://forums.realmacsoftware.com/t/formatting-broken-on-localhost-when-set-as-relative-to-docroot/1916/4 "2015-08-27T08:29:27Z")

</div>

I mention Safari simply as an example - maybe you could post a screenshot with the Web Inspector open so we can take a look at the errors in it? (Open the Inspector, click on a warning, take screenshot).

---

<div class="post-metadata">

**Author:** ![ashleykaryl](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/ashleykaryl/32/4202_2.png) [@ashleykaryl](https://forums.realmacsoftware.com/u/ashleykaryl)\
**Post date:** [August 27, 2015, 8:32am UTC](https://forums.realmacsoftware.com/t/formatting-broken-on-localhost-when-set-as-relative-to-docroot/1916/5 "2015-08-27T08:32:48Z")

</div>

OK here it is:

 ![](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/1X/2008ce93b9315089a3b55f5de77f95e5cc3b282c.jpg)

---

<div class="post-metadata">

**Author:** ![nikf](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/nikf/32/10_2.png) [@nikf](https://forums.realmacsoftware.com/u/nikf)\
**Post date:** [August 27, 2015, 8:33am UTC](https://forums.realmacsoftware.com/t/formatting-broken-on-localhost-when-set-as-relative-to-docroot/1916/6 "2015-08-27T08:33:37Z")

</div>

Sorry, I meant “Errors” - I’ll check back once I’ve made a coffee 😉

---

<div class="post-metadata">

**Author:** ![ashleykaryl](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/ashleykaryl/32/4202_2.png) [@ashleykaryl](https://forums.realmacsoftware.com/u/ashleykaryl)\
**Post date:** [August 27, 2015, 8:34am UTC](https://forums.realmacsoftware.com/t/formatting-broken-on-localhost-when-set-as-relative-to-docroot/1916/7 "2015-08-27T08:34:41Z")

</div>

Actually I realised I’d messed up the moment I posted it 😀

 ![](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/1X/3fb4da2983c0a44a7c76ed6354d2d282d9a0582a.jpg)

---

<div class="post-metadata">

**Author:** ![ashleykaryl](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/ashleykaryl/32/4202_2.png) [@ashleykaryl](https://forums.realmacsoftware.com/u/ashleykaryl)\
**Post date:** [August 27, 2015, 8:36am UTC](https://forums.realmacsoftware.com/t/formatting-broken-on-localhost-when-set-as-relative-to-docroot/1916/8 "2015-08-27T08:36:24Z")

</div>

It mentions the 403 error to [typography.com](http://typography.com) but I was seeing this issue long before using them and I think I’ll be removing their fonts because they are slow loading.

---

<div class="post-metadata">

**Author:** ![nikf](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/nikf/32/10_2.png) [@nikf](https://forums.realmacsoftware.com/u/nikf)\
**Post date:** [August 27, 2015, 8:38am UTC](https://forums.realmacsoftware.com/t/formatting-broken-on-localhost-when-set-as-relative-to-docroot/1916/9 "2015-08-27T08:38:00Z")

</div>

So looking at those URLs, it looks as though you’ve set up the MAMP server for the folder that **contains** the `CMP_Foundation` folder, not the sub-folder itself. If you point MAMP at the correct folder (so that `http://localhost:8888/` itself loads the contents of `CMP_Foundation`) you should be all set.

---

<div class="post-metadata">

**Author:** ![ashleykaryl](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/ashleykaryl/32/4202_2.png) [@ashleykaryl](https://forums.realmacsoftware.com/u/ashleykaryl)\
**Post date:** [August 27, 2015, 8:42am UTC](https://forums.realmacsoftware.com/t/formatting-broken-on-localhost-when-set-as-relative-to-docroot/1916/10 "2015-08-27T08:42:39Z")

</div>

OK I see what is happening now. I have a folder on Dropbox called Exported that contains 3 or 4 site project folders. Once I navigate to the [http://localhost:8888](http://localhost:8888) I can then open the folders and view the sites normally when links are set as relative to Page. When set as relative to DOCROOT they break. Putting the site contents back in the main directory fixes it. Does that sound like correct behaviour from RW?

---

<div class="post-metadata">

**Author:** ![nikf](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/nikf/32/10_2.png) [@nikf](https://forums.realmacsoftware.com/u/nikf)\
**Post date:** [August 27, 2015, 8:46am UTC](https://forums.realmacsoftware.com/t/formatting-broken-on-localhost-when-set-as-relative-to-docroot/1916/11 "2015-08-27T08:46:39Z")

</div>

Hi Ashley,

Apologies if I’m being unclear: there is no “behaviour from RW” here. The _only_ behaviour that is affecting this is due to your MAMP configuration not being correct. You’re asking the site to use DOCROOT-based URLs, which RapidWeaver generates correctly. Once RW has exported (again, correctly) you’ve chosen to locate the site in a place _other than DOCROOT_. So of course it’ll display wrongly 😉 You’d need to point MAMP to the folder for the site so that MAMP can correctly set up the web server and ensure that DOCROOT is applied correctly.

Thanks,

—N

---

<div class="post-metadata">

**Author:** ![ashleykaryl](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/ashleykaryl/32/4202_2.png) [@ashleykaryl](https://forums.realmacsoftware.com/u/ashleykaryl)\
**Post date:** [August 27, 2015, 8:50am UTC](https://forums.realmacsoftware.com/t/formatting-broken-on-localhost-when-set-as-relative-to-docroot/1916/12 "2015-08-27T08:50:24Z")

</div>

Sure I get it now. I found it rather convenient previously being able to access a main Export folder and then select any given project as it allowed me to keep everything tidily in one place with no hassles. That is not possible when using relative to DOCROOT. I would have to change the preferred folder in MAMP preferences every time I want to view a site or never have more than one project in the Export folder.

---

<div class="post-metadata">

**Author:** ![nikf](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/nikf/32/10_2.png) [@nikf](https://forums.realmacsoftware.com/u/nikf)\
**Post date:** [August 27, 2015, 8:52am UTC](https://forums.realmacsoftware.com/t/formatting-broken-on-localhost-when-set-as-relative-to-docroot/1916/13 "2015-08-27T08:52:28Z")

</div>

IIRC, MAMP Pro allows you to create multiple hosts. So perhaps `http://cmpfoundation:8888` for that folder, etc etc. We’ve used it this way in the past, for both the RMS site and things like the Community. It’s really useful.

---

<div class="post-metadata">

**Author:** ![ashleykaryl](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/ashleykaryl/32/4202_2.png) [@ashleykaryl](https://forums.realmacsoftware.com/u/ashleykaryl)\
**Post date:** [August 27, 2015, 8:55am UTC](https://forums.realmacsoftware.com/t/formatting-broken-on-localhost-when-set-as-relative-to-docroot/1916/14 "2015-08-27T08:55:04Z")

</div>

OK good to know. I’ve just been using the free version up to now. Perhaps AMPPS also allows this as well but I’ll have to investigate.
