Re: Re: UrlRewrite htaccess confusion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You can use a regexp for search and replace in your files.

packages.php?category=([^&]+)&year=([^&]+)&title=([^&]+)

The problem is those values are variables on the code.

As Shawn said, it is easier to provide some function to create links.If you
need to change all links you only change the function and the work is done.

cheers,

On Thu, Oct 29, 2009 at 2:31 PM, Shawn McKenzie <nospam@xxxxxxxxxxxxx>wrote:

> 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
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Martin Scotta

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux