My wordpress has clean urls enabled, it works great... but I'd also like to use rewrite rule for my static pages (it's a site with html static front + wordpress pages). Here is my .htaccess file: RewriteEngine on RewriteRule ^Levitra\.html$ http://www.domain.com/product.php?item=Levitra <IfModule mod_rewrite.c> RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /articles/index.php [L] </IfModule> Code (markup): Wordpress uses: <IfModule mod_rewrite.c> RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /articles/index.php [L] </IfModule> Code (markup): When I added the following with wordpress codes (above), it doesn't work but it works when the wordpress codes are removed: RewriteEngine on RewriteRule ^Levitra\.html$ http://www.domain.com/product.php?item=Levitra Code (markup): Can anyone help me with combining both? Thanks
Hi, I would try this : Options +FollowSymlinks RewriteEngine on RewriteRule ^Levitra\.html$ /product.php?item=Levitra <IfModule mod_rewrite.c> RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /articles/index.php [L] </IfModule> Code (markup): For information : - 302 redirect : RewriteRule ^Levitra\.html$ http://www.domain.com/product.php?item=Levitra Code (markup): - pure server rewriting : RewriteRule ^Levitra\.html$ /product.php?item=Levitra Code (markup): Jean-Luc
Jean-Luc, It didn't work. I used the pure server rewriting code (which is what I want to acheve), but it couldn't work with domain.com/Levitra.html. Does this have anything to do with it being an add-on domain? I put the .htaccess in the same directory
I am using a very similar .htaccess on my WordPress blog and it works fine. I have no idea where your problem comes from. I assume you put the .htaccess in the root directory of this domain.com. What do you mean when you write "It didn't work" : error 404 or error 500 or anything else ? Jean-Luc