WordPress.org

Ready to get started?Download WordPress

Forums

Adding custom url rewrite to wordpress? (3 posts)

  1. gokul_8.9
    Member
    Posted 3 years ago #

    I have a wordpress site with url rewrite activated. I want to add two more url rewrites for my custom page

    RewriteRule ^page/([^/]*)$ page.php?$id=$1 [L]
    RewriteRule ^page/2/([^/]*)$ page2.php?$id=$1 [L]

    But when i add these lines, no use. It redirects to the wordpress page and saying no post found. How can i achieve this..

  2. Mike Schinkel
    Member
    Posted 3 years ago #

    Can you post your entire /.htaccess file so we can see the context in which you were using?

  3. gokul_8.9
    Member
    Posted 3 years ago #

    this is in my htaccess

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

    # END WordPress

    But if i add

    RewriteRule ^page/([^/]*)$ page.php?$id=$1 [L]
    RewriteRule ^page/2/([^/]*)$ page2.php?$id=$1 [L]

    to the top, no use. Please help me..

Topic Closed

This topic has been closed to new replies.

About this Topic