Wordpress and static html page .htaccess not working properly

Discussion in 'Apache' started by PipSqueak, Jul 1, 2006.

  1. #1
    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
     
    PipSqueak, Jul 1, 2006 IP
  2. Jean-Luc

    Jean-Luc Peon

    Messages:
    601
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #2
    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, Jul 1, 2006 IP
  3. PipSqueak

    PipSqueak Guest

    Messages:
    100
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    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
     
    PipSqueak, Jul 1, 2006 IP
  4. Jean-Luc

    Jean-Luc Peon

    Messages:
    601
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #4
    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
     
    Jean-Luc, Jul 1, 2006 IP
  5. PipSqueak

    PipSqueak Guest

    Messages:
    100
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    It gave a "Error 404 - Not Found" :(

    Can I PM you?
     
    PipSqueak, Jul 1, 2006 IP