NYCPHP Meetup

NYPHP.org

[nycphp-talk] not including '.php' in URI

Adler Medrado adlermedrado at gmail.com
Wed Mar 22 15:06:03 EST 2006


Hello Kenneth.

Thank you !!


adler medrado


2006/3/22, Kenneth Dombrowski <kenneth at ylayali.net>:
>
>
> for Ajai & Adler,
>
> mod_rewrite is another way.  here's more of my example from yesterday
> (from an .htaccess file)
>
> note RewriteLog cannot be set from .htaccess files, so you might have to
> develop your rules locally, on a server you control, and only upload
> them to your hosted account after they work.
>
> # ======================================================================
> # RewriteRules to support old-style and friendly URLs
> # ======================================================================
> # *** For debugging set RewriteLog in httpd.conf ***
> #
> RewriteEngine On
> #
> #                    F I N A L   R E Q U E S T S
> #
> # these are requests for the actual files on disk; stop processing.
> #
> RewriteRule ^catalog.php$               - [NC,L]
> RewriteRule ^account.php$               - [NC,L]
> RewriteRule ^index.php                  - [NC,L]
> RewriteRule ^search.php                 - [NC,L]
> #
> #                          O L D   U R L S
> #
> # add support for URLs from old version of site, to avoid breaking
> # bookmarks/links/caches.  The redirects will indicate to the user that
> # the correct URL has changed (due to [R])
> #
> # index.php is no longer the artist search page
> RewriteRule ^index.php?selection=ARTS   catalog/artists [NC,R,L]
> RewriteRule ^index.php?selection=(.*)   catalog/artists/$1 [NC,R,L]
> # former by-name searches
> RewriteRule ^index.php?whomlab=(.*)     catalog/label/$1 [NC,R,L]
> RewriteRule ^index.php?whomart=(.*)     catalog/artist/$1 [NC,R,L]
> #
> #                      F R I E N D L Y   U R L S
> #
> # (note we are intentionally not using the [R] flag here)
> #
> RewriteRule ^account$                   account.php [NC,L]
> RewriteRule ^account/edit$              account.php?action=edit [NC,L]
> RewriteRule ^catalog/recent$            catalog.php?filter=recent [NC,L]
> RewriteRule ^catalog/artists$           catalog.php?list=artists [NC,L]
> # catalog/artist/dead+c -> catalog.php?filter=artist&name=dead+c
> RewriteRule ^catalog/artist/(.*)$       catalog.php?filter=artist&name=$1
> [NC,L]
> RewriteRule ^search$                    search.php [NC,L]
> #
> # support a few common mistakes (_do_ use the [R] flag here):
> #
> RewriteRule ^catalog/search$            search.php [NC,L,R]
>
>
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
> New York PHP Conference and Expo 2006
> http://www.nyphpcon.com
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
>



--
Nesher Technologies
http://www.neshertech.net
http://adler.neshertech.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20060322/aaa12722/attachment.html>


More information about the talk mailing list