Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I need some help! I'm trying to rewrite this...

localhost/blog/?c=var  to->  localhost/blog/var 

But seems there is some problem... I get a 500 :( I also believe there is some conflict with the default rules of wordpress too. This is my entire htaccess:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) localhost/blog/?c=$1  [L]

# BEGIN WordPress
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
# END WordPress
</IfModule>

Any idea? Thanks

share|improve this question

closed as too localized by toscho Jan 2 '13 at 23:10

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers 2

I'm no expert, but your rules look okay to me. Try using the IP address of your machine or 127.0.0.1 for localhost. Also, put a "$" after the closing parenthesis in your rule.

share|improve this answer

Try this:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_URI} ^/blog/.*$
RewriteRule /blog/?c=([^\&]*) $1 [L]

# BEGIN WordPress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
# END WordPress
</IfModule>

Since RewriteBase is defined, you shouldn't have to specify /blog/ again in the redirection part.

RewriteEngine On and RewriteBase needn't be repeated, not sure if repeating them causes problems.

Let me know whether this helped :)

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.