Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Query strings and mod_rewrite...

2:05 am on Jan 17, 2004 (gmt 0)

10+ Year Member

I use PHP includes to pull content into my site's design container.

So, I have URL's that look like this:


That I'd like to rewrite to


So, I tried this...

RewriteCond %{QUERY_STRING} ^go=$
RewriteRule ^index\.php$ /columns/%1/ [L]

but I don't think I'm even close... any help?


2:09 am on Jan 17, 2004 (gmt 0)

10+ Year Member

btw, my PHP script looks like this...

if (isset($go)) {
} else {

2:13 am on Jan 17, 2004 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member


Welcome to WebmasterWorld [webmasterworld.com]!

I think you're real close!

RewriteCond %{QUERY_STRING} ^go[b]=/(.*)[/b]$
RewriteRule ^index\.php$ /column[b]s/%1?[/b] [L]

The trailing question mark of the rewrite substitution string clears the existing query-string. You may not need it. Also, the rewrite code may need to be preceded with

Options +FollowSymLinks
RewriteEngine on

if you don't already have that in your .htaccess file


2:25 am on Jan 17, 2004 (gmt 0)

10+ Year Member

Okay... this is now in my .htaccess file

Options +FollowSymLinks
RewriteEngine On

RewriteCond %{QUERY_STRING} ^go=/(.*)$
RewriteRule ^index\.php$ /columns/%1? [L]

But when I goto, say


where archives/001.html is the content of the string, but I'm getting a 404 error...

Any more thoughts? I'm also in a subdomain...don't know if that matters or not.