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

Posted by Jerry Stuckle on 07/17/07 00:43

Paul Furman wrote:
> NC wrote:
>> On Jul 10, 5:14 pm, Paul Furman <pa...@-edgehill.net> wrote:
>>
>>> OK so no considerations for my php coding?
>>
>>
>> None whatsoever.
>>
>>
>>>>> Right now I've got urls & code like this:
>>>>> http://www.edgehill.net/1/?SC=go.php&DIR=California
>>>
>>>>> But I'd prefer:
>>>>> http://www.edgehill.net/California
>>>
>>>>> I'd like to see at most:
>>>>> http://www.edgehill.net/California/Bay-Area/San-Francisco/
>>>
>>>> If your hosting company allows .htaccess files, add these lines to
>>>> your .htaccess file in the site's root directory:
>>>
>>>> RewriteEngine on
>>>> RewriteRule ^California(.*)$ /1/?SC=go.php&DIR=California$1 [NC,L]
>>>
>>>> This should do the trick.
>>>
>>> Looks cool, from what I can tell, the only thing to learn is the
>>> syntax & rule evaluating order.
>>
>>
>> Hence, the links:
>>
>> http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html
>> http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
>
>
> Ack... regular expressions!!!!!!!!!
>
> Anyone interested in a little consulting to get me up to speed on a
> basic framework for this system, please email. I've got a couple web
> sites that could use this upgrade but it's beyond me for now to even get
> a basic effect to take hold with .htaccess on the first one I tried.
>
>
>>> Sounds like I could set up however big an htaccess file to
>>> identify my simplified structure but maybe at some point
>>> it would take a hit on performance... or not if I figure
>>> out how to tell it to stop searching the rule list.
>>
>>
>> That's actually easy; you put [L] (meaning, "last") after the rule.
>> If Apache executes a rule with [L] after it, it stops looking for
>> other rules to execute.
>>
>> Cheers,
>> NC
>>
>
>

I'd suggest you try asking in alt.apache.configuration. That's where
those gurus hang out.

There are a few here with knowledge about how to do it, but many more
over there.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

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

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