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

Posted by NC on 07/10/07 23:22

On Jul 10, 3:56 pm, Paul Furman <p...@-edgehill.net> 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

[skipped]

> I'd like to see at most:
> http://www.edgehill.net/California/Bay-Area/San-Francisco/[skipped]

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.

Cheers,
NC

 

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

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