1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Problem with WordPress htaccess file?

Discussion in 'Blogging' started by BlackBeret, Oct 24, 2008.

  1. BlackBeret

    BlackBeret Regular Member

    Joined:
    Jul 12, 2008
    Messages:
    257
    Likes Received:
    61
    Location:
    Transexual, Transylvania
    I just moved my site to a new server, and now I can't navigate into a subfolder on the site. My site is set up like this:

    mainsite.com
    mainsite.com/Blog Where the WP Blog is
    mainsite.com/OtherProgram Where my other program is


    When I try to visit mainsite.com/OtherProgram it keeps coming back as 404 error in the blog. It didn't do this before the move. The /OtherProgram still exists and has an index.php file.

    The following is the htaccess file from the root directory:

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

    I don't remember if it was in the root directory before the move, but I would have thought it should have only been in the /Blog directory. I tried removing it from the root directory, but only got a different error.

    Anyone have any ideas? I was going to add a 404 redirect, but it would probably just get caught in a loop.
     
  2. centerpoint

    centerpoint Junior Member

    Joined:
    Jul 16, 2008
    Messages:
    122
    Likes Received:
    33
    Location:
    Canada
    Are you trying to redirect all traffic from domain.com/ to domain.com/blog/ ?

    Personally I put the htaccess file for my blogs in the root folder of the WP install
     
  3. BlackBeret

    BlackBeret Regular Member

    Joined:
    Jul 12, 2008
    Messages:
    257
    Likes Received:
    61
    Location:
    Transexual, Transylvania
    No, I'm not trying to redirect the traffic. The site at mainsite.com still comes up and works fine.
     
  4. centerpoint

    centerpoint Junior Member

    Joined:
    Jul 16, 2008
    Messages:
    122
    Likes Received:
    33
    Location:
    Canada
    Try removing the htaccess from the root
    and placing the following in the root of the blog folder

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

    BlackBeret Regular Member

    Joined:
    Jul 12, 2008
    Messages:
    257
    Likes Received:
    61
    Location:
    Transexual, Transylvania
    It turns out to be a problem with the register_globals in the /OtherProgram .htaccess file. It needs it to be on, but I can't figure out how to do this in php 5.2.6. I guess my old server was running an older copy of php and I could turn it on with

    php_value register_globals 1

    in the htaccess file. 5.2.6 doesn't seem to allow php_value. It is a pretty old program, maybe I should get a new one. Everywhere I read says to leave global_registers off.
     
  6. albaniax

    albaniax Elite Member

    Joined:
    Aug 5, 2008
    Messages:
    1,586
    Likes Received:
    823
    Location:
    GER - ALB
    you canĀ“t turn on register_globals in the .htaccess ... If you have Confixx on your server, try it there or change it directly on the php.ini file.

    Have you also mod_rewrite acitvated for the directory?
    And safe_mode off?

    Show me your log of the server, when you get the 404 Error, it shows you there, what wrong is.
     
  7. BlackBeret

    BlackBeret Regular Member

    Joined:
    Jul 12, 2008
    Messages:
    257
    Likes Received:
    61
    Location:
    Transexual, Transylvania
    What directory does the php.ini go into? I can't find it. I don't want to turn on register_globals for the whole site in case it is a security risk. I only want to enable for this folder.

    The error code I keep getting is:

    /.htaccess: Invalid command 'register_globals', perhaps mis-spelled or defined by a module not included in the server configuration
     
  8. BlackBeret

    BlackBeret Regular Member

    Joined:
    Jul 12, 2008
    Messages:
    257
    Likes Received:
    61
    Location:
    Transexual, Transylvania
    Thanks everybody for the help, especially albaniax. I added the phpini.php file to the /OtherProgam folder and it seems to work now.
     
  9. centerpoint

    centerpoint Junior Member

    Joined:
    Jul 16, 2008
    Messages:
    122
    Likes Received:
    33
    Location:
    Canada
    It is recommended that you leave register globals off However if needed You can change this for your site by adding a line to the .htaccess file in your root home folder:

    php_value register_globals on

    Im fairly sure it cannot be set for an individual folder