Why can't I put something on the end of this URL?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Why can't I put something on the end of this URL?

Post by simonmlewis »

I am using this in HTACCESS:

Code: Select all

RewriteRule ^a_alternatives/page/([0-9]+) /index.php?page=a_alternatives&pagenum=$1 [L,QSA]
To take this:
[text]/a_alternatives/page/6&id=2108&u=y&altid=KINGPIN[/text]
and action on the variables.

Problem is, it won't do anything at all. The page turns over, and stays on the page number, but doesn't do anything.
The script works on page one, where there is no /page/ in the URL.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Why can't I put something on the end of this URL?

Post by Celauran »

Code: Select all

/a_alternatives/page/6?id=2108&u=y&altid=KINGPIN
Change that first ampersand to a question mark and you're golden.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Why can't I put something on the end of this URL?

Post by simonmlewis »

Will try that again, as I did try it before and it didn't work at all.
That said, I have since tried it without the shorturls (as it's not for consumers) and that worked.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
Post Reply