Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] [OT] Creating user-friendly URLS with mod_rewrite/Apache
- Date: Fri, 18 Aug 2006 14:56:26 +0900 (JST)
- From: David E <dave@???>
- Subject: Re: [tlug] [OT] Creating user-friendly URLS with mod_rewrite/Apache
- References: <44E53F8A.90605@example.com>
On Date: Fri, 18 Aug 2006 13:18:18 +0900, Dave M G <martin@example.com> wrote: > So what I really want is for Apache and PHP to play nice together so > that it will take pretty much anything after the ".com", in the above > example where it says "kevin_cooney", and pass that to index.php to be > used for looking up data in the database and passing the right information. > > But wait, there's another issue here. On my "tokyocomedy.com" web site, > there is an actual subdirectory called "japanese", which is all about > the Japanese side of the comedy group, and all the HTML in there is > maintained by a different dude than me. So I'd want to make sure that > certain exceptions will go to the right directory. > The tricky part seems to be getting Apache to work without at least some > kind of "category" directory. After all, without that, what would I > specify in ".htaccess" in order to tell Apache where to take the link? Most of the popular CMSs use something like the following snippet in an .htaccess file (or right in the apache config). What it does is essentially say, If the requested URI matches a real file or directory, proceed as normal. If not, call index.php (or whatever you set it to) which then needs to take care of the request one way or the other (for example send 404 if it's a missing image file) RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*) index.php HTH, Dave
- Follow-Ups:
- Re: [tlug] [OT] Creating user-friendly URLS with mod_rewrite/Apache
- From: Dave M G
- Re: [tlug] [OT] Creating user-friendly URLS with mod_rewrite/Apache
- From: romans malinovskis
- References:
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] New Custom Server for Linux - Advice Needed
- Next by Date: Re: [tlug] New Custom Server for Linux - Advice Needed
- Previous by thread: Re: [tlug] [OT] Creating user-friendly URLS with mod_rewrite/Apache
- Next by thread: Re: [tlug] [OT] Creating user-friendly URLS with mod_rewrite/Apache
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links