The MU forums have moved to WordPress.org

How to create an extra Rewrite Rule inside .htacces (2 posts)

  1. guarri-man
    Member
    Posted 15 years ago #

    Hi.

    I'm trying to create an additional Rewrite Rule appart from those created by WordPress Mu. The extra line is:
    -------
    RewriteRule ^faq index.php?page_id=119 [R,L]
    -------

    However, I want users see 'http://myblog.com/faq' and not 'http://myblog.com/index.php?page_id=379'. This line works with other Apache configurations, but not with mine. Any suggestion?

    ---------------------------------
    RewriteEngine On
    RewriteBase /
    DirectoryIndex index.php

    # MY OWN REWRITE RULES
    RewriteRule ^faq index.php?page_id=119 [R,L]

    # Rewrite http://www.domain.com to domain.com
    RewriteCond %{HTTP_HOST} ^www\.(.*)
    RewriteRule ^(.*) http://%1/$1 [R,L]

    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    ------------------------------------------

  2. peaforabrain
    Member
    Posted 15 years ago #

    Place this in your .htaccess;

    RewriteRule ^faq/?$ /index.php?page_id=119 [QSA,L]

    Also, put htis at the top of the file;

    Options +FollowSymLinks

    Try that

About this Topic

  • Started 15 years ago by guarri-man
  • Latest reply from peaforabrain