Forum Moderators: phranque

Message Too Old, No Replies

querystring not being passed from .htaccess

         

daktau

2:03 pm on Jan 8, 2010 (gmt 0)

10+ Year Member



Hi,
I have here my .htaccess file.

#################
RewriteEngine on
Options +FollowSymlinks
RewriteBase /

#SHOULD REWRITE ALL MADE UP PAGE NAMES TO THE EVENT PHP PAGE WITH NICE LI'L QUERYSTRING
RewriteRule ^/events/(.+)$ events.php?page=$1 [NC]

Options +Indexes +MultiViews +FollowSymlinks
IndexIgnore *
###################

It is forwarding to the correct .php page but with no querystring.

Should not this work? I'm sure I've done this before.....

thanks for any suggestions.
cheers,
George

g1smd

3:33 pm on Jan 8, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Remove the leading forward-slash from the pattern if you are using this code in .htaccess.

daktau

2:19 pm on Jan 9, 2010 (gmt 0)

10+ Year Member



Hi,
Thanks for this but the problem still persists.
I m now using...

RewriteRule ^events/(.+)$ events.php?page=$1 [NC]

...but still nothing is passed to events.php via a querystring.
Even if I set the rule to be

RewriteRule ^events/(.+)$ events.php?page=hardcoded_msg [NC]

I do not receive anything.

Have you any more sugestions as to why this is happening?

thanks,
George

g1smd

4:05 pm on Jan 9, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You'll need [L] as well as NC. Other than that I can't think of anything else right now.

jdMorgan

5:03 pm on Jan 9, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Also, just to be sure, try

Options +FollowSymlinks [b]-MultiViews[/b]

Be sure to delete your browser cache after making any changes to your server-side code.

Another thing you can try is to inject a syntax error into your rule; If the server doesn't throw an error (check your server error log file), then perhaps mod_rewrite isn't available to you.

Other than that, it's down to saying the RewriteRule pattern must exactly match the requested URL-path, and if it does not, no rewrite will occur.

Jim

daktau

9:11 pm on Jan 9, 2010 (gmt 0)

10+ Year Member



Thanks to you both.

I now have it working, this line was preventing the querystring...
Options +Indexes +MultiViews +FollowSymlinks

Changing it to...
+MultiViews
fixed it.

cheers,
George