Re: Search like php.net's URL thingy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey!

Thanks for replying.

Digging a bit more i found 

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^([a-z][0-9][A-Z][aA0-zZ0])$ jj.php?show=$1
</IfModule>

But it does not work :( do you see any fault with the above?

Thanks!
R


 ------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)



----- Original Message ----
From: Bernhard Kohl <bk@xxxxxxxxxx>
To: Ryan S <genphp@xxxxxxxxx>
Sent: Thursday, June 5, 2008 9:25:46 PM
Subject: Re:  Search like php.net's URL thingy

you should familiarize yourself with the rewrite module of the apache server (if u operate on that one)

it's pretty much the same as regular expressions syntax

example:

i want all requests going to www.example.com/test being forwarded to index.php?a=test

place following into your .htaccess file in the root directory:

RewriteEngine on
RewriteBase /

RewriteRule ^([a-zA-Z])$ index.php?a=$1

the whole thing can get pretty complex with alot of rewrite conditions and stuff.

good luck


On 6/5/08, Ryan S <genphp@xxxxxxxxx> wrote:
Hey,
one of the things that make the php.net site so cool is how easy it is to find info for a function or a list of topics.. eg:

http://php.net/arrays
http://php.net/count

I'm sure nearly all of you reading this have done it more times than you would care to count, i'm trying to get something like this on my own site but even after going to php.net and clicking on the view source buttons am a bit confused.

basically this is what i am trying, people who type in http://www.mysite.com/asdf
should not be shown a 404 not found page but instead "asdf" should be passed onto my script where i can do a search on the term and either give them back the results of that search or direct them to a custom 404 page.

since i couldnt find the answer via php.net's source i started messing around with how i *think* its done... tell me if i am on the correct track: when someone requests a page that does not exist, a .htaccess file them up and also takes the page name they were searching for and redirects them to a script...

So far i have only been able to get the .htaccess file point to my custom 404 page... but how do i get it to pass the parameter of the not-found-page to my script?

Would appreciate any code, tips, urls you can give me.

Thanks!
Ryan



  ------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


      

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux