Re: [PHP] URL rewriting...anybody done this?

2004-01-15 Thread Ryan A
Hey Justin,

Ok,
 tried this with differient tests and directives for the past 2 days,
on 3 differient servers,
on 5 differient domains.
I updated the directives more times than I care to remember and restarted
apache so many times
I dont think it knows if its coming or goingbut you sir...are a f*g
genius coz the sob after
hours of frustration spanning 2 days.is working!

I just copied everything you wrote exactly and pasted themthen hit the
url on 3 differient servers...
and all 3 are giving me results...

Looks like the list has a new problem solver...watch out (Cpt) John Holmes!
:-D

Cheers,
-Ryan

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-15 Thread Justin French
On Friday, January 16, 2004, at 11:04  AM, Ryan A wrote:

RewriteEngine On
Options +FollowSymlinks
RewriteRule ^tt/(.*).php tt.php?id=$1
This is my php page:
";
if(isset($_GET["id"])){echo "Got \$_GET[id]";}else{echo "No
\$_GET[id]";}
print_r($_GET);
print_r($_REQUEST);
print_r($_GET['id']);
?>
Ryan,

This would have been solved a lot quicker on a list dedicated to Apache.

I tested this, and it works:

.htaccess
---
#Options +FollowSymlinks

RewriteEngine On
RewriteRule ^tt.php/(.*) tt.php?id=$1
RewriteRule ^tt.php/(.*).php tt.php?id=$1

---
With this tt.php file:
---
tt.php



---
A few notes:

- I commented out the Options line because *my* Apache set-up doesn't 
need it, but yours may (it depends on the httpd.conf file).

- I've tested the above with the following URLs:
- http://indentclients.com/tests/ryan/tt/45.php
- http://indentclients.com/tests/ryan/tt/45
- http://indentclients.com/tests/ryan/tt/45/
- http://indentclients.com/tests/ryan/tt.php/45.php
- http://indentclients.com/tests/ryan/tt.php/45
- http://indentclients.com/tests/ryan/tt.php/45/
In all cases, it output:
Array
(
[id] => 45
)
- it also works for me without the  and  lines

- if this STILL doesn't work, it's more than likely that your host does 
not allow mod_rewrite, doesn't allow you total freedom in your 
.htaccess file, etc etc -- find a new host.

Justin French

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


Re: [PHP] URL rewriting...anybody done this?

2004-01-15 Thread Ryan A
Hey,
Thanks for replying.

Globals are on heres my phpinfo page:
http://cheap-php-web-hosting.com/phpinfo.php

this is my .htaccess file:

RewriteEngine On
Options +FollowSymlinks
RewriteRule ^tt/(.*).php tt.php?id=$1

This is my php page:
";
if(isset($_GET["id"])){echo "Got \$_GET[id]";}else{echo "No
\$_GET[id]";}
print_r($_GET);
print_r($_REQUEST);
print_r($_GET['id']);
?>

heres from where i am calling it:
http://cheap-php-web-hosting.com/tt/23


DAMN thing does not work.

Any ideas?

-Ryan





and heres how I am calling it
On 1/16/2004 12:55:22 AM, Peter Vertes ([EMAIL PROTECTED]) wrote:
> I had the same problem with PHP after
> I've upgraded to 4.3.3 from 4.3.1. I was tearing my hair out but couldn't
> figure out what was wrong. I ended up editing my php.ini file and turning
> REGISTER GLOBALS = On. It works fine now and since this is on my
> development box I
> don't really care about security that much. Hope this helped...
>
> -Pete
>
> P.S.: This all happened on a Gentoo Linux box...
>
> On Wed, 2004-01-14 at 17:11, Ryan A wrote: Oops sorry, missed that. Heres
whats on top of the page: echo "Ok,we are in show.php";
if(isset($_GET["id"])){echo "Got \$_GET[id]";}else{echo "No
\$_GET[id]";} if(isset($_GET["sid"])){echo "Got
\$_GET[sid]";}else{echo "No \$_GET[sid]";} print_r($_GET);
print_r($_GET['id']); print_r($_GET['sid']); and heres the output: Ok,we are
in show.php No $_GET[id] No $_GET[sid] Array ( ) Ideas? Cheers, -Ryan On
1/14/2004 10:56:35 PM, Jason Wong ([EMAIL PROTECTED]) wrote: > On
Thursday 15 January 2004 05:01, Ryan A wrote: > > > I put this in for
testing: > > > > if(isset($_GET["id"])){echo "Got \$_GET[id]";}else{echo
> "No > > \$_GET[id]";} > > if(isset($_GET["sid"])){echo "Got
\$_GET[sid]";}else{echo > "No > > \$_GET[sid]

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-15 Thread Peter Vertes




I had the same problem with PHP after I've upgraded to 4.3.3 from 4.3.1.  I was tearing my hair out but couldn't figure out what was wrong.  I ended up editing my php.ini file and turning REGISTER GLOBALS = On.  It works fine now and since this is on my development box I don't really care about security that much.  Hope this helped...

-Pete

P.S.: This all happened on a Gentoo Linux box...

On Wed, 2004-01-14 at 17:11, Ryan A wrote:

Oops sorry, missed that.

Heres whats on top of the page:

echo "Ok,we are in show.php";
if(isset($_GET["id"])){echo "Got \$_GET[id]";}else{echo "No
\$_GET[id]";}
if(isset($_GET["sid"])){echo "Got \$_GET[sid]";}else{echo "No
\$_GET[sid]";}
print_r($_GET);
print_r($_GET['id']);
print_r($_GET['sid']);

and heres the output:

Ok,we are in show.php
No $_GET[id]
No $_GET[sid]
Array ( )


Ideas?

Cheers,
-Ryan




On 1/14/2004 10:56:35 PM, Jason Wong ([EMAIL PROTECTED]) wrote:
> On Thursday 15 January 2004 05:01, Ryan A wrote:
>
> > I put this in for testing:
> >
> > if(isset($_GET["id"])){echo "Got \$_GET[id]";}else{echo
> "No
> > \$_GET[id]";}
> > if(isset($_GET["sid"])){echo "Got \$_GET[sid]";}else{echo
> "No
> > \$_GET[sid]";}
> >
> > and heres the output:
> > No $_GET[id]
> > No $_GET[sid]
> >
> > So the variables are not being passed
> > Any idea why and what I can do about this?
> > (Am a total newbie here)
>
> As was previously suggested just do a
>
> print_r($_GET)
>
> to see what, if anything,
> you're getting.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> Price's
> Advice:
> It's all a game -- play it to have fun.
> */
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php




-- 
perl -e 'print pack("H*", "70766572746573406E79632E72722E636F6D0A")'








signature.asc
Description: This is a digitally signed message part


Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Jason Wong
On Thursday 15 January 2004 09:42, Ryan A wrote:

> Nope, does not work.
>
> Looks like I got a problem that finally stumped the whole listlucky me

This works fine for me:

RewriteEngine On
RewriteRule ^show/(.*)/(.*)/(.*) /show.php?a=$1&b=$2&c=$3

What version of Apache/PHP are you using?
Have you checked bugs.php.net?
You're not using some weirdo operating system like Windows are you?

If all else fails you can use the 'parse the URL' method that I outlined 
earlier.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
It is now 10 p.m.  Do you know where Henry Kissinger is?
-- Elizabeth Carpenter
*/

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Jason Wong
On Thursday 15 January 2004 09:28, Justin Patrin wrote:
> > RewriteEngine On
> > RewriteRule ^show/(.*)/(.*) /show.php?sid=$1&id=$2
>
> Try:
> RewriteRule ^show/([^/]*)/([^/]*) /show.php?sid=$1&id=$2

The original ought to work just fine -- I have it working here.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Don't put off for tomorrow what you can do today because if you enjoy it 
today,
you can do it again tomorrow.
*/

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Ryan A
Hey,
Thanks for replying.

Nope, does not work.

Looks like I got a problem that finally stumped the whole listlucky me
:-p

Cheers,
-Ryan

On 1/15/2004 2:28:33 AM, Justin Patrin ([EMAIL PROTECTED]) wrote:
> > RewriteEngine On
> > RewriteRule ^show/(.*)/(.*) /show.php?sid=$1&id=$2
>
> Try:
> RewriteRule ^show/([^/]*)/([^/]*) /show.php?sid=$1&id=$2
>
> --
> paperCrane 
> --
> Question Everything, Reject Nothing
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Justin Patrin
RewriteEngine On
RewriteRule ^show/(.*)/(.*) /show.php?sid=$1&id=$2
Try:
RewriteRule ^show/([^/]*)/([^/]*) /show.php?sid=$1&id=$2
--
paperCrane 
--
Question Everything, Reject Nothing
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Ryan A
Hi again,
I did a little pokeing around and installed this on 3 differient
serversand the results were identical...
so its not the servers fault but something with the directives...

got some interesting results with my testing

am using this:
echo "Ok,we are in show.php";
if(isset($_GET["id"])){echo "Got \$_GET[id]";}else{echo "No
\$_GET[id]";}
if(isset($_GET["sid"])){echo "Got \$_GET[sid]";}else{echo "No
\$_GET[sid]";}
print_r($_GET);

This is still not working:
http://rizkhan.net/articles/show/2/1
(output is:  )
Ok,we are in show.php
No $_GET[id]
No $_GET[sid]
Array ( )

This gives the exact expected results (working)
http://rizkhan.net/articles/show/?sid=1&id=2 (note I dont have to write
show.php)

This gives me screwy results:
http://rizkhan.net/articles/show/?1/2
(output is:  )
Ok,we are in show.php
No $_GET[id]
No $_GET[sid]
Array ( [1/2] => )

in case you guys forgot, this is what i entered into my httpd.conf:

 #of course i entered the correct path#
Options ExecCGI FollowSymLinks Includes MultiViews
AllowOverride all


This is my htaccess file:

RewriteEngine On
RewriteRule ^show/(.*)/(.*) /show.php?sid=$1&id=$2

incase i forgot to mention it...this "#¤"#¤#" thing is not working.


ANY ideas?

Thanks,
-Ryan

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Matt Matijevich
I am a little late but I have used the method described on a list apart
http://www.alistapart.com/articles/succeed/ and it works really
well.
You might want to give it a try, I think it works a little bit
different than the way you are trying.

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Ryan A
Hey,
At least you remember what it used to look like, I dont!
Soo many modificatios in both .htaccess and httpd.conf and restarts...have
just lost track.

Will try your example one at a time and see what happens.

Thanks again.

Cheers,
-Ryan

> Seems like you are getting closer. You are going to the right place, but
> none of your variables are making it. I am not sure what your rule looks
> like now, but at one point it was:
>
> RewriteRule ^show/(.*)/(.*)/(.*) /show.php?category=poetry&sid=$2&id=$3
>
> I would recommend trying just one variable first. See if you can get
> that to work, then add the others one at a time. Maybe something like
> this to start with:
>
> RewriteRule ^show/(.*) /show.php?foo=$1
>
> And see what $_GET looks like.
>
> - Brad

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Brad Pauly
On Wed, 2004-01-14 at 15:11, Ryan A wrote:

[snip]

> and heres the output:
> 
> Ok,we are in show.php
> No $_GET[id]
> No $_GET[sid]
> Array ( )
> 
> 
> Ideas?

Seems like you are getting closer. You are going to the right place, but
none of your variables are making it. I am not sure what your rule looks
like now, but at one point it was:

RewriteRule ^show/(.*)/(.*)/(.*) /show.php?category=poetry&sid=$2&id=$3

I would recommend trying just one variable first. See if you can get
that to work, then add the others one at a time. Maybe something like
this to start with:

RewriteRule ^show/(.*) /show.php?foo=$1

And see what $_GET looks like.

- Brad

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Ryan A
Oops sorry, missed that.

Heres whats on top of the page:

echo "Ok,we are in show.php";
if(isset($_GET["id"])){echo "Got \$_GET[id]";}else{echo "No
\$_GET[id]";}
if(isset($_GET["sid"])){echo "Got \$_GET[sid]";}else{echo "No
\$_GET[sid]";}
print_r($_GET);
print_r($_GET['id']);
print_r($_GET['sid']);

and heres the output:

Ok,we are in show.php
No $_GET[id]
No $_GET[sid]
Array ( )


Ideas?

Cheers,
-Ryan




On 1/14/2004 10:56:35 PM, Jason Wong ([EMAIL PROTECTED]) wrote:
> On Thursday 15 January 2004 05:01, Ryan A wrote:
>
> > I put this in for testing:
> >
> > if(isset($_GET["id"])){echo "Got \$_GET[id]";}else{echo
> "No
> > \$_GET[id]";}
> > if(isset($_GET["sid"])){echo "Got \$_GET[sid]";}else{echo
> "No
> > \$_GET[sid]";}
> >
> > and heres the output:
> > No $_GET[id]
> > No $_GET[sid]
> >
> > So the variables are not being passed
> > Any idea why and what I can do about this?
> > (Am a total newbie here)
>
> As was previously suggested just do a
>
> print_r($_GET)
>
> to see what, if anything,
> you're getting.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> Price's
> Advice:
> It's all a game -- play it to have fun.
> */
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Jason Wong
On Thursday 15 January 2004 05:01, Ryan A wrote:

> I put this in for testing:
>
> if(isset($_GET["id"])){echo "Got \$_GET[id]";}else{echo "No
> \$_GET[id]";}
> if(isset($_GET["sid"])){echo "Got \$_GET[sid]";}else{echo "No
> \$_GET[sid]";}
>
> and heres the output:
> No $_GET[id]
> No $_GET[sid]
>
> So the variables are not being passed
> Any idea why and what I can do about this?
> (Am a total newbie here)

As was previously suggested just do a 

  print_r($_GET)

to see what, if anything, you're getting.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Price's Advice:
It's all a game -- play it to have fun.
*/

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Ryan A
Hey,
I put this in for testing:

if(isset($_GET["id"])){echo "Got \$_GET[id]";}else{echo "No
\$_GET[id]";}
if(isset($_GET["sid"])){echo "Got \$_GET[sid]";}else{echo "No
\$_GET[sid]";}

and heres the output:
No $_GET[id]
No $_GET[sid]

So the variables are not being passed
Any idea why and what I can do about this?
(Am a total newbie here)

Cheers,
-Ryan



On 1/14/2004 9:27:03 PM, Brad Pauly ([EMAIL PROTECTED]) wrote:
> On Wed, 2004-01-14 at 13:14, Ryan A wrote:
> > Hey,
> > Ok, have added "echo "Ok,we are in show.php";" and if you go to
> > http://rizkhan.net/articles/show/category/1/2 or
> > http://rizkhan.net/articles/show.php?category=poetry&sid=1&id=2
> >
> > you will see that its echoing that without a problem..so this is
> > partly working.
> >
> > now what to do about the variables?
>
> Well, are any of them in $_GET? If so, are they getting assigned to the
> right place? How about putting a print_r($_GET) in show.php.
>
> - Brad

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Brad Pauly
On Wed, 2004-01-14 at 13:14, Ryan A wrote:
> Hey,
> Ok, have added "echo "Ok,we are in show.php";" and if you go to 
> http://rizkhan.net/articles/show/category/1/2 or
> http://rizkhan.net/articles/show.php?category=poetry&sid=1&id=2
> 
> you will see that its echoing that without a problem..so this is
> partly working.
> 
> now what to do about the variables?

Well, are any of them in $_GET? If so, are they getting assigned to the
right place? How about putting a print_r($_GET) in show.php.

- Brad

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Ryan A
Hey,
Ok, have added "echo "Ok,we are in show.php";" and if you go to 
http://rizkhan.net/articles/show/category/1/2 or
http://rizkhan.net/articles/show.php?category=poetry&sid=1&id=2

you will see that its echoing that without a problem..so this is
partly working.

now what to do about the variables?

Thanks,
-Ryan 
 
> Do you have a print or echo in show.php to see if you are getting there?
> I would work on getting the rule to take you to the right place first,
> then worry about the variables.
> 
> - Brad
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Lowell Allen
[snip]
> 
> I took out the .php part...and even tried it with [L] tacked to the end of
> the second linenot working
> Heres how my .htaccess looks now:
> 
> RewriteEngine On
> RewriteRule ^show/(.*)/(.*)/(.*) /show.php?category=poetry&sid=$2&id=$3
> 
> I even took out the space which was in category.
> 
> Any ideas?
> 
[snip]

Make sure you upload the .htaccess file as ASCII mode, not binary. (That
wasted lots of my time recently.)

--
Lowell Allen

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Brad Pauly
On Wed, 2004-01-14 at 12:41, Ryan A wrote:
> Hey Jason, Brad,
> Thanks for replying.
> 
> I took out the .php part...and even tried it with [L] tacked to the end of
> the second linenot working
> Heres how my .htaccess looks now:
> 
> RewriteEngine On
> RewriteRule ^show/(.*)/(.*)/(.*) /show.php?category=poetry&sid=$2&id=$3
> 
> I even took out the space which was in category.
> 
> Any ideas?

Do you have a print or echo in show.php to see if you are getting there?
I would work on getting the rule to take you to the right place first,
then worry about the variables.

- Brad

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Ryan A
Hey Jason, Brad,
Thanks for replying.

I took out the .php part...and even tried it with [L] tacked to the end of
the second linenot working
Heres how my .htaccess looks now:

RewriteEngine On
RewriteRule ^show/(.*)/(.*)/(.*) /show.php?category=poetry&sid=$2&id=$3

I even took out the space which was in category.

Any ideas?

Thanks,
-Ryan


On 1/14/2004 8:11:47 PM, Brad Pauly ([EMAIL PROTECTED]) wrote:
> On Wed, 2004-01-14 at 11:44, Ryan A wrote:
>
> [snip]
>
> > Its a bit hard to explain what happens so see for yourself:
> > Heres the index page:
> > http://www.rizkhan.net/articles/articles.php
> > Heres the actual page:
> > http://www.rizkhan.net/articles/show.
> php?category=Beginners%20Corner&sid=1&id=1
> > and then if you modify it to:
> > http://www.rizkhan.net/articles/show/Beginners%20Corner/1/1
>
> [snip]
>
> > Any ideas?
>
> One thing I noticed is that your rule is looking for a .php at the end
> so the above url will not match.
>
> RewriteEngine On
> RewriteRule ^show/(.*)/(.*)/(.*).php
> /show.php?category=Beginners%20Corner&sid=$2&id=$3
>
> I don't remember for sure, but do you need an [L] at the end of the
> second line?
>
> - Brad
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Lowell Allen
> On Thursday 15 January 2004 02:44, Ryan A wrote:
> 
>> It seems to be partly working.
>> 
>> /*
>> How isn't it working? What happens? I would try one variable first, get
>> that working, then add the others. Also, I am not sure how it will
>> handle the space in "Beginners Corner". Try passing simple values first.
>> */
>> Its a bit hard to explain what happens so see for yourself:
>> Heres the index page:
>> http://www.rizkhan.net/articles/articles.php
>> Heres the actual page:
>> http://www.rizkhan.net/articles/show.php?category=Beginners%20Corner&sid=1&;
>> id=1 and then if you modify it to:
>> http://www.rizkhan.net/articles/show/Beginners%20Corner/1/1
>> 
>> it just shows me the index...which even links wrong.
>> 
>> Ok, will try to pass a value without the space in between.
> 
 RewriteRule ^show/(.*)/(.*)/(.*).php
 /show.php?category=Beginners%20Corner&sid=$2&id=$3
> 
> It doesn't look like your rule would match. Try:
> RewriteRule ^show/(.*)/(.*)/(.*)
> 
> Another way to achieve a similar result without using Rewrite is to parse
> $_SERVER['REQUEST_URI'], and possibly $_SERVER['PATH_INFO']
> 
> Eg if your link is:
> 
> http://www.rizkhan.net/articles/show.php/Beginners%20Corner/1/1
> 
> Then $_SERVER['REQUEST_URI'] would contain
> 
> /articles/show.php/Beginners%20Corner/1/1
> 
> and $_SERVER['PATH_INFO'] would contain
> 
> /Beginners%20Corner/1/1

Ryan,

I'm doing what I believe Jason is indicating above. I'm sure in your
research you read the articles about URL rewriting on A List Apart,
specifically this one: . Using
a similar approach, I'm saving page content in a database with the unique
identifier set to the desired value of $REQUEST_URI. After redirecting all
requests to index.php as described in the article, I use code in index.php
similar to what's in the article, plus this for the database content:

-

// check for database content
$conn = db_connect();
if (!$conn) {
$db_error = mysql_error();
include("error_page.php");
exit();
}
// get the page details from db
$request = substr($REQUEST_URI, 1);
$results = mysql_query("SELECT DisplayStatus FROM Pages WHERE
MenuPath='$request' AND DisplayStatus='Y'");
if (!$results) {
$db_error = mysql_error();
include("error_page.php");
exit();
}
if (mysql_num_rows($results) > 0) {
include("page.php");
exit();
}

// if request has not been matched, include custom error page
include("notfound.php");
exit();

-

That pulls page content based on $REQUEST_URI. I build site menus from the
database, using values from the MenuPath field as URLs.

HTH

--
Lowell Allen

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Brad Pauly
On Wed, 2004-01-14 at 11:44, Ryan A wrote:

[snip]

> Its a bit hard to explain what happens so see for yourself:
> Heres the index page:
> http://www.rizkhan.net/articles/articles.php
> Heres the actual page:
> http://www.rizkhan.net/articles/show.php?category=Beginners%20Corner&sid=1&id=1
> and then if you modify it to:
> http://www.rizkhan.net/articles/show/Beginners%20Corner/1/1

[snip]

> Any ideas?

One thing I noticed is that your rule is looking for a .php at the end
so the above url will not match.

RewriteEngine On
RewriteRule ^show/(.*)/(.*)/(.*).php
/show.php?category=Beginners%20Corner&sid=$2&id=$3

I don't remember for sure, but do you need an [L] at the end of the
second line?

- Brad

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Jason Wong
On Thursday 15 January 2004 02:44, Ryan A wrote:

> It seems to be partly working.
>
> /*
> How isn't it working? What happens? I would try one variable first, get
> that working, then add the others. Also, I am not sure how it will
> handle the space in "Beginners Corner". Try passing simple values first.
> */
> Its a bit hard to explain what happens so see for yourself:
> Heres the index page:
> http://www.rizkhan.net/articles/articles.php
> Heres the actual page:
> http://www.rizkhan.net/articles/show.php?category=Beginners%20Corner&sid=1&;
>id=1 and then if you modify it to:
> http://www.rizkhan.net/articles/show/Beginners%20Corner/1/1
>
> it just shows me the index...which even links wrong.
>
> Ok, will try to pass a value without the space in between.

> > > RewriteRule ^show/(.*)/(.*)/(.*).php
> > > /show.php?category=Beginners%20Corner&sid=$2&id=$3

It doesn't look like your rule would match. Try:
  RewriteRule ^show/(.*)/(.*)/(.*)

Another way to achieve a similar result without using Rewrite is to parse 
$_SERVER['REQUEST_URI'], and possibly $_SERVER['PATH_INFO']

Eg if your link is:

  http://www.rizkhan.net/articles/show.php/Beginners%20Corner/1/1

Then $_SERVER['REQUEST_URI'] would contain

  /articles/show.php/Beginners%20Corner/1/1

and $_SERVER['PATH_INFO'] would contain

  /Beginners%20Corner/1/1

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
You'd like to do it instantaneously, but that's too slow.
*/


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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Ryan A
Hey,
Thanks for replying.

It seems to be partly working.

/*
How isn't it working? What happens? I would try one variable first, get
that working, then add the others. Also, I am not sure how it will
handle the space in "Beginners Corner". Try passing simple values first.
*/
Its a bit hard to explain what happens so see for yourself:
Heres the index page:
http://www.rizkhan.net/articles/articles.php
Heres the actual page:
http://www.rizkhan.net/articles/show.php?category=Beginners%20Corner&sid=1&id=1
and then if you modify it to:
http://www.rizkhan.net/articles/show/Beginners%20Corner/1/1

it just shows me the index...which even links wrong.

Ok, will try to pass a value without the space in between.


/*
I am assuming you have Apache compiled with mod_rewrite and you have the
proper settings in httpd.conf (ie. LoadModule). Did you restart Apache?
*/

Yep, mod_rewrite is installed (http://rizkhan.net/phpinfo.php)
I did restart apache.

Any ideas?

-Ryan



On 1/14/2004 7:34:56 PM, Brad Pauly ([EMAIL PROTECTED]) wrote:
> On Wed, 2004-01-14 at 11:14, Ryan A wrote:
> > Hi,
> > I have a blog kind of app running on my site...presently it shows like
> this:
> > show.php?category=Beginners%20Corner&sid=1&id=1
> >
> > After searching on google on how to make my blog my search engine
> friendly I
> > came accorss
> > mod_rewrite and couple of tutorials on it, finally the one I understood
> and
> > tried to use was this one:
> >
> > http://www.phpfreaks.com/tutorials/23/0.php
> >
> > so I added this to my .htaccess:
> > RewriteEngine On
> > RewriteRule ^show/(.*)/(.*)/(.*).php
> > /show.php?category=Beginners%20Corner&sid=$2&id=$3
> >
> > and added this to my httpd.conf:
> > AccessFileName .htaccess
> > 
> > AllowOverride all
> > Order allow,deny
> > Deny from all
> > Satisfy All
> > 
> >
> > 
> > Options ExecCGI FollowSymLinks Includes MultiViews
> > AllowOverride all
> > 
> >
> > But somehow its not working :-(( I made the changes in the httpd.conf
> and
> > also in a .htaccess file...
>
> How isn't it working? What

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Brad Pauly
On Wed, 2004-01-14 at 11:14, Ryan A wrote:
> Hi,
> I have a blog kind of app running on my site...presently it shows like this:
> show.php?category=Beginners%20Corner&sid=1&id=1
> 
> After searching on google on how to make my blog my search engine friendly I
> came accorss
> mod_rewrite and couple of tutorials on it, finally the one I understood and
> tried to use was this one:
> 
> http://www.phpfreaks.com/tutorials/23/0.php
> 
> so I added this to my .htaccess:
> RewriteEngine On
> RewriteRule ^show/(.*)/(.*)/(.*).php
> /show.php?category=Beginners%20Corner&sid=$2&id=$3
> 
> and added this to my httpd.conf:
> AccessFileName .htaccess
> 
> AllowOverride all
> Order allow,deny
> Deny from all
> Satisfy All
> 
> 
> 
> Options ExecCGI FollowSymLinks Includes MultiViews
> AllowOverride all
> 
> 
> But somehow its not working :-(( I made the changes in the httpd.conf and
> also in a .htaccess file...

How isn't it working? What happens? I would try one variable first, get
that working, then add the others. Also, I am not sure how it will
handle the space in "Beginners Corner". Try passing simple values first.

I am assuming you have Apache compiled with mod_rewrite and you have the
proper settings in httpd.conf (ie. LoadModule). Did you restart Apache?

- Brad

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



[PHP] URL rewriting...anybody done this?

2004-01-14 Thread Ryan A
Hi,
I have a blog kind of app running on my site...presently it shows like this:
show.php?category=Beginners%20Corner&sid=1&id=1

After searching on google on how to make my blog my search engine friendly I
came accorss
mod_rewrite and couple of tutorials on it, finally the one I understood and
tried to use was this one:

http://www.phpfreaks.com/tutorials/23/0.php

so I added this to my .htaccess:
RewriteEngine On
RewriteRule ^show/(.*)/(.*)/(.*).php
/show.php?category=Beginners%20Corner&sid=$2&id=$3

and added this to my httpd.conf:
AccessFileName .htaccess

AllowOverride all
Order allow,deny
Deny from all
Satisfy All



Options ExecCGI FollowSymLinks Includes MultiViews
AllowOverride all


But somehow its not working :-(( I made the changes in the httpd.conf and
also in a .htaccess file...

PLEAS HEEELLP.

Thanks in advance,
-Ryan

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