You are here: Re: forward named page to php query « All PHP « IT news, forums, messages
Re: forward named page to php query

Posted by Disco Octopus on 12/03/05 14:00

Disco Octopus wrote:

> Hi,
>
> I have a site that uses php query string quite a bit.
>
> EG. my pages URLs look like this....
>
> example.com/event.php?eve=78
>
> I would like to make this a little nicer for the URL and for search
> engines, etc, and be able to have some kind of forwarding or redirecting to
> take this....
>
> example.com/event/swimming_in_the_pool
> ...or...
> example.com/swimming_in_the_pool_event
> .. and point to...
> example.com/event.php?eve=78
>
> Does anyone know how I would do this in my .htaccess file or http.conf
> file.
>
> Thanks

I have got a little way with some searching on the web.
This is what I have come up with....

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^events/(.*).html /event.php?eventcode=$1 [L]

I would expect that this url....

example.com/events/swimming_in_the_pool.html
....would end up executing this page...
example.com/event?eventcode=swimming_in_the_pool
.... however, I am getting a return code of 404 - Not found.

Any ideas?

Thanks

--
a beef jerky site http://www.choicebeefjerky.com.au
not a beef jerky site http://mycoolwheels.com/vote.cmks
nobody ever dreams of working for the man

 

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

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