You are here: Re: Simpler urls « PHP Programming Language « IT news, forums, messages
Re: Simpler urls

Posted by Paul Furman on 07/23/07 05:02

Michael Fesser wrote:
> .oO(Paul Furman)
>
>
>>Hmm, OK I looked into this some more and it doesn't appear to be
>>practical because I have a huge number of destination urls & as I
>>understand, I'd need to actually list all those in the .htaccess file.
>
>
> This depends on the URLs. Of course listing all possible URLs is
> absolutely pointless. That's not what regular expressions are for.
> But if there would be a common structure inside them, like
>
> http://example.com/state/area/city
>
> you could easily match all of them with a single regular expression.

Just a followup, I found a consultant to tutor me through this and I got
away with just rewriting the top level folders in .htaccess then
allowing any number of subfolders to be appended. Here's what it looks like:

RewriteRule ^gallery/?$
index.php?SC=go.php&DIR=0_gallery [NC]

RewriteRule ^gallery/Photo-Update(/.+)?$
index.php?SC=go.php&DIR=0_gallery/0-Photo-Update$1 [NC]

RewriteRule ^gallery/(.+)$
index.php?SC=go.php&DIR=0_gallery/$1 [NC]

Then I also have to go back & rewite my links to the new format. I'm
still working out plenty of bugs but I got the basic thing rolling.

--
Paul Furman Photography
http://www.edgehill.net/1
Bay Natives Nursery
http://www.baynatives.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

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