Re: UrlRewrite htaccess confusion
| From: | Shawn McKenzie | Date: | Thu, 29 Oct 2009 17:31:58 +0000 |
| Subject: | Re: UrlRewrite htaccess confusion | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-299529@lists.php.net to get a copy of this message | ||
Shawn McKenzie wrote:
> Rob Gould wrote:
>> You are indeed correct! Absolute URLs for everything, images, css,
>> javascript, and links fixed the issue. Took me forever to change every
>> link in the whole site, but it's happy now. Seems like there ought to
>> be an easier way.
>>
>
> There is an easier way. The logic depends upon your app, but create a
> function that builds and optionally echos URLs for you. It can work out
> the base url or you can do that when you initialize your app and define
> it as a constant. It can be as simple or as complex as you need.
>
> <a href="<?php makelink($file, $arrayOfVars); ?>">Something</a>
>
> -- or --
>
> echo '<a href="' . makelink($file, $arrayOfVars) .
> '">Something</a>';
>
Or the simplist approach is to define at constant at app initialization
and use it:
echo '<a href="' . BASEURL .
'packages/basketball/2010/nba-all-star-game">Something</a>';
--
Thanks!
-Shawn
http://www.spidean.com