You are here: Re: can you redirect every existing html page through a php function? « PHP Programming Language « IT news, forums, messages
Re: can you redirect every existing html page through a php function?

Posted by Stephen Kay on 11/18/46 11:43

in article C04F1F23.5AE27%sk@karma-lab.nospam.com, Stephen Kay at
sk@karma-lab.nospam.com wrote on 3/28/06 5:16 PM:

>> What server are you using?
>> If you are using apache then you can use RewriteRule ... It will do exactly
>> what you are after.
>>
>> RewriteRule ^([^/]+)/([^/]+).html$ /dopage.php?p=$1 [L]
>>
>> Then you can worry about what dopage.php actually does.

I said:

> Hi Simon,
> I've been fooling around with this, and it shows signs of working for things
> like:
>
> www.mysite.com/folder/somepage.html
> However, it doesn't work for something that is in the root html folder,
> www.mysite.com/somepage.html
> Since I don't understand the syntax (yet), any suggestions?


I see, it's something like:

RewriteRule ^([^/]+)/([^/]+).html$ /dopage.php?p=$1
RewriteRule ^/([^/]+).html$ /dopage.php?p=$1 [L]

But the problem I'm having with this is that, if I rewrite all URLs and send
them to dopage.php, and then in dopage.php I'm calling curl to open a page
of my website, at that point it gets redirected the same way and there's an
infinite loop.


--
Stephen Kay
Karma-Lab sk@karma-lab.NOSPAM.com
^^^^^^^

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация