Forum Moderators: phranque

Message Too Old, No Replies

mod_rewrite problem

         

rlkanter

3:57 am on Oct 13, 2005 (gmt 0)

10+ Year Member



I'm trying to do this:

If they type in a # in the url it goes to that topic, for example:

1250 would display display_topic.php?topic=1250

Also if they put a / at the end it displays that page number:

1250/2 would display_topic.php?topic=1250&page=2

I tried:

RewriteRule ([0-9]+)/([0-9]+) display_topic.php?topic=$1&page=$2

But this doesn't work.

Thanks.

dcrombie

10:06 am on Oct 13, 2005 (gmt 0)



Not sure if I'm clear what you're doing. If you're talking about applying rewrite rules to text in the URL that appears _after_ a '#' then you're out of luck because that information is never passed to the webserver.

rlkanter

5:30 pm on Oct 13, 2005 (gmt 0)

10+ Year Member



Sorry, I'll try to explain it better

If they go to [somesite...]

I want it to go to [somesite...]

if they go to [somesite...]

I want it to go to
[somesite...]

If that is not possible, I guess a comma instead of a slash would be fine

[somesite...] -> [somesite...]

Currently I have mod_rewrite working for the topic part, but I can't get the page part to work.

Thanks again.

rlkanter

7:02 pm on Oct 13, 2005 (gmt 0)

10+ Year Member



Figured out my problem, I needed two rules, here is how I ended up doing it if anyone is interested :)

RewriteRule ([0-9]+)/([0-9]+) display_topic.php?topic=$1&page=$2
RewriteRule ([0-9]+) display_topic.php?topic=$1