|
Posted by Paul Furman on 07/21/07 21:19
NC wrote:
> Paul Furman wrote:
>
>>I want to have urls that work like the php.net
>>pages where there's just a word after a slash,
>>maybe a few folders deep.
>
> This has almost nothing to do with PHP. This is a HTTP server-level
> problem. Apache has a module called mod_rewrite, which can be
> configured to accomplish what you want:
>
> http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html
> http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
>
>>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.
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.
It seems I might be better off doing my own parsing in php which also
would not be easy but then I could direct things more flexibly &
accommodate any number of destination urls. Does this sound right?
--
Paul Furman Photography
http://www.edgehill.net/1
Bay Natives Nursery
http://www.baynatives.com
Navigation:
[Reply to this message]
|