Re: URL Rewriting

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

 



On Wed, 22 Jun 2011 17:50:49 -0400 Daniel P. Brown wrote:
> > Has someone a Link with Tutorials or other Information?
> 
>     Not entirely sure what you're asking here, or how you (or the
> nginx folks) expect it to relate to PHP.  Do you mean that you want to
> use PHP to have theme2.php act as if it was called as theme.php?id=2 ?

I have me write a blog, but my blog has link like blogdetail.html?id=1 or =2
through 16 at moment. And for google and other Search  Engines not good the
links, better where i can rewrite to a fix link, and when someone use the
link, php write to correct url. 

Sorry my english not perfect on earth. 

 
>     If so, it's not redirect or rewrite, and it's extremely hacky, but
> this is the only real way PHP could achieve the desired result:
> 
> <?php
> // dynamictheme.php
> 
> if (preg_match('/.*([0-9]+)\.php/Ui',$_SERVER['PHP_SELF'],$match)) {
>   $_GET['id'] = $match[1];
>   include dirname(__FILE__).'/theme.php';
> }
> 
> ?>
> 
>     Then just symlink dynamictheme.php to your various themes like so:
> 
>     ln -s dynamictheme.php theme2.php
>     ln -s dynamictheme.php theme301.php
>     ln -s dynamictheme.php theme18447.php
> 


Regards 
Silvio

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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