Skip to content

Commit

Permalink
Edited wiki page through web user interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
steve@mrclay.org committed Feb 4, 2010
1 parent c6b4d68 commit f60c9b9
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions UriRewriting.wiki
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,7 @@ You can see the steps used to rewrite your URIs by enabling [Debugging debug mod

== Document Root Confusion ==

Minify's `$min_documentRoot` should be the directory accessed by `http://example.com/`. Let's say `http://localhost/` corresponds to `C:\xampp\htdocs`. If you want to test a site by placing it in a subdirectory like `http://localhost/testSite/` that does *not* mean you can change `$min_documentRoot`.

Currently Minify requires all file paths to specified from Apache's `DocumentRoot` (not necessarily the root of your "site"). There are two ways to work around this limitation:

1. Use a virtual host for your test site. This has many more advantages besides an easy Minify configuration. Tutorials: [http://apptools.com/phptools/virtualhost.php 1], [http://foundationphp.com/tutorials/apache22_vhosts.php 2], [http://www.visualwin.com/host-header/ IIS6]

2. Use dynamic Minify URLs that change depending on the host you're on.

{{{
<?php
if ($_SERVER['HTTP_HOST'] == 'localhost') {
$minPath = '/siteA/min/';
$minBase = 'b=siteA&amp;'
} else {
$minPath = '/min/';
$minBase = '';
}
?>
<link href="<?= $minPath ?><?= $minBase; ?>f=styles/site.css">
<script src="<?= $minPath ?><?= $minBase; ?>f=scripts.js"></script>
}}}

If this looks ugly to you, I agree with you.
Out-of-the-box, Minify gets confused when `min` is placed in a subdirectory of the real document root. There's now a [AlternateFileLayouts simple workaround] for this, making `min` more portable.

== Aliases / Symlinks / Virtual Directories ==

Expand Down

0 comments on commit f60c9b9

Please sign in to comment.