WordPress.org

Ready to get started?Download WordPress

Forums

Custom .htaccess RewriteRules generates 404 on index.php redirection (1 post)

  1. mani_monaj
    Member
    Posted 8 years ago #

    I used wordpress 1.5.2 for about a year, But not as start page for my website, I used ‎‎.htaccess file to customize some redirection to send wordpress backward without ‎changing any wordpress settings, in 1.5.2 I added these settings to .htaccess file :‎

    DirectoryIndex home.php index.php
    RewriteRule ^weblog.php$ index.php [R]‎
    RewriteRule ^weblog$ index.php
    RewriteRule ^about$ home.php?go=about
    RewriteRule ^contact$ home.php?go=contact
    RewriteRule ^projects$ home.php?go=recprojects

    Right after wordpress rules. ‎

    My home.php file is my frontpage and gets some variables to show some static ‎information like ‘about’ and ‘recent projects’. I can not use WordPress Pages because my ‎static information is in English but my WordPress Weblog is in Persian (Farsi). As you ‎see in rules /weblog and /weblog.php redirects to wordpress index.php file. [In wordpress ‎settings both ‘WordPress address’ & ‘Blog address’ are http://www.manionline.org.‎

    These hacks works great on 1.5.2 , but when I upgraded to 2.0.2 , I get WordPress 404 ‎error when I try to see my weblog by http://www.manionline.org/weblog , everything else ‎seems to work, static pages still work , and if I use http://www.manionline.org/index.php I can ‎see my weblog without any problem(all wordpress links works) , here is the .htaccess file ‎‎: ‎

    DirectoryIndex home.php index.php

    ‎<IfModule mod_rewrite.c>‎
    RewriteEngine On
    RewriteBase /‎
    ‎ ‎
    RewriteRule ^weblog.php$ index.php [R]‎
    RewriteRule ^weblog$ index.php ‎
    RewriteRule ^about$ home.php?go=about
    RewriteRule ^contact$ home.php?go=contact
    RewriteRule ^projects$ home.php?go=recprojects

    ‎# BEGIN WordPress
    RewriteCond %{REQUEST_FILENAME} !-f ‎
    RewriteCond %{REQUEST_FILENAME} !-d ‎
    RewriteRule . /index.php [L]‎
    ‎# END WordPress

    ‎</IfModule>‎

    I tried to track down the source to find the problem , But I was not able to do so , I MUST ‎still use http://www.manionline.org/weblog as a redirection to wordpress, because many people ‎linked to my weblog through that address. ‎

Topic Closed

This topic has been closed to new replies.

About this Topic