0

hi ive set up a rewrite and it works perfectly, here it is

RewriteRule ^polls-([0-9]+)\.html$ poll.php?poll_id=$1

This would allow an URL like polls-1.html instead of poll.php?poll_id=1.

My problem is this; i have another variable to view results, this is what i would usually call - poll.php?poll_id=1&showResults=1

How do i set up a rule where i can use some thing like: polls-1/results-1.html ?? Ive searched the net for a while but cant find anything

1 Answer 1

1

Add another Rule, like this:

RewriteRule ^polls-([0-9]+)\/results\.html$ poll.php?poll_id=$1&showResults=1

It will redirect polls-1/results.html to poll.php?poll_id=1&showResults=1

Sign up to request clarification or add additional context in comments.

1 Comment

it was a good answer and works to a certain extent. However it fails to load any CSS or JS on the results pages

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.