Forum Moderators: phranque

Message Too Old, No Replies

mod rewrite help for php file

         

mingchen

9:06 pm on Apr 28, 2005 (gmt 0)



Hello,

After expericing heavy loads on specific topics on a phpBB I've been trying to use mod rewrite to divert specific phpbb topic to static pages.

An .htaccess file with this:

RewriteEngine On
RewriteRule ^viewtopic\.php$ staticpage.html

will divert anything hitting viewtopic.php to staticpage.html

I'm looking for the specific code to divert:

http://www.example.com/forums/viewtopic.php?t=34252

and I'm coming up short on the correct syntax to add in the '?t=34252' ending so traffic can be diverted.

Any help on this is greatly appreciated. Thanks.

--MING

[edited by: jdMorgan at 9:27 pm (utc) on April 28, 2005]
[edit reason] Examplified. [/edit]

jdMorgan

9:26 pm on Apr 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ming,

Welcome to WebmasterWorld!

See RewriteCond [httpd.apache.org] in the mod_rewrite documentation.

Specifically, you'll be using


RewriteCond %{QUERY_STRING} ^t=34252

Along with the rewriterule matching the base URL.

Jim