Forum Moderators: phranque

Message Too Old, No Replies

Using rewrite rule for query strings in htaccess.

How to use Wordpress that uses php?

         

crobb305

2:36 am on May 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In my htaccess, I used a rewrite rule to cause any url with a query string to display 410 "Gone" error page.

However, to use Wordpress, it requires php scripts to run. The url links on my blog look like: http://www.example.com/blog/?cat=2

So my question is, how can I allow certain strings, and disallow others?

My current rewrite rule looks like this:

RewriteEngine On
RewriteCond %{QUERY_STRING}!^$
RewriteRule .* - [G]

freewebsiteideas

4:34 pm on May 2, 2006 (gmt 0)

10+ Year Member



Wordpress has sef urls built into the latest version 2.0

crobb305

5:29 pm on May 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What do you mean by "sef" urls? I am using the latest Wordpress, and since I have rewrite rules on my query strings, I get "page not found" errors on all of my blog links that have /?cat= or /?page=

C

crobb305

6:11 pm on May 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ah...SEF= Search Engine Friendly :)

Took me a minute. I am reading up on how to do this with WP right now.

Thanks
C

BananaFish

8:01 pm on May 2, 2006 (gmt 0)

10+ Year Member



In wordpress you just go on your dashboard and somewhere there is a place it will automatically generate an .htaccess file with the appropriate rewrites.