Brad
Brad

Reputation: 2237

.htaccess ModRewrite question

trying to do rewrite rule for this:
http://website.com/checkreg/34324234 <--- Old URL Location

to this: http://website.com/chkreg.php?checkreg=34324234 <--- New URL Address

I've tried the following, but it causes an error 500 message, I don't know enough about ModRewrite to figure out the issue.


# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^checkreg/([^/]*)$ /chkreg.php?checkreg=$1 [L] 
RewriteRule . /index.php [L]

</IfModule>

# END WordPress

Upvotes: 0

Views: 82

Answers (1)

Taylor Leese
Taylor Leese

Reputation: 52300

You said you want to rewrite from http://website.com/chkreg.php?checkreg=34324234 to http://website.com/checkreg/34324234, but your rewrite rule is doing the opposite.

Use this:

RewriteRule ^chkreg.php?checkreg=(.*) /checkreg/$1 [L] 

Edit: If you need further debugging information from mod_rewrite then add the following:

RewriteLog /your/path/rewrite.log
RewriteLogLevel 3

Upvotes: 1

Related Questions