• Hi.

    I have used the search feature, but haven’t seem to have found a solution to my problem.

    I basically want to have my wordpress rewrite rule:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    And on top of that, I want to use my own rewrite rule for some of my pages:

    RewriteRule ^about$ about.php
    RewriteRule ^photographs$ gallery.php
    RewriteRule ^templates$ templates.php
    RewriteRule ^links$ links.php
    RewriteRule ^contact$ contact.php
    RewriteRule ^contactsecure$ contact_secure.php
    RewriteRule ^accessibility$ accessibility.php
    RewriteRule ^privacy$ privacy.php
    RewriteRule ^legal$ copyright.php

    But the problem is that if I put these rules together, they clash. Is there anyway around this without me having to use wordpress as a CMS?

Viewing 3 replies - 1 through 3 (of 3 total)
  • theres no problem with that..

    what you need to do is put those rules before the regualr wordpress stuff AND you need to use stop the processing at that rule ..

    so you do this:

    <IfModule mod_rewrite>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^about$ about.php [L]
    RewriteRule ^photographs$ gallery.php [L]
    RewriteRule ^templates$ templates.php [L]
    RewriteRule ^links$ links.php [L]
    RewriteRule ^contact$ contact.php [L]
    RewriteRule ^contactsecure$ contact_secure.php [L]
    RewriteRule ^accessibility$ accessibility.php [L]
    RewriteRule ^privacy$ privacy.php [L]
    RewriteRule ^legal$ copyright.php [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    Thread Starter trwilliams

    (@trwilliams)

    But that doesn’t work, just get 404 on all pages including blog posts.

    Thread Starter trwilliams

    (@trwilliams)

    Fixed.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Mod_rewrite’ is closed to new replies.