htaccess experts please help

Discussion in 'Apache' started by hitagent, Sep 22, 2008.

  1. #1
    This is my first post here ever, I hope I don't make a mess.

    Please help me with this htaccess problem. I'll try to explain:

    I was asked by my script vendor to put the .htaccess within my script directory.

    
    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*) index.php?/$1 [L]
    RewriteRule ^$ /index.php [L]
    RewriteCond $1 !^(index\.php|install|img|images|scripts|fonts|uploads|css|js|robots\.txt|sitemap\.xml|favicon\.ico)
    RewriteRule (.*)-(.*)\.html$ wallpapers/show/$2
    RewriteRule (.*)-(.*)/$ categories/show/$2
    
    Code (markup):
    As you can see the above code is for base directory i.e. the main site, and my script lies in a sub-directory i.e. " /test/ ". after uploading the above htaccess i was getting 404 errors but i changed the htaccess to this :

    
    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /test
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*) /test/index.php?/$1 [L]
    RewriteRule ^$ /test/index.php [L]
    RewriteCond $1 !^(index\.php|install|img|images|scripts|fonts|uploads|css|js|robots\.txt|sitemap\.xml|favicon\.ico)
    RewriteRule (.*)-(.*)\.html$ wallpapers/show/$2
    RewriteRule (.*)-(.*)/$ categories/show/$2
    
    Code (markup):
    But Now I am facing a new problem, few of the links are working and few are not.

    My links without htaccess looks like this.

    http://www.*****.com/test/index.php?/members
    http://www.*****.com/test/index.php?/contact
    http://www.*****.com/test/index.php?/categories/show/1
    http://www.*****.com/test/index.php?/wallpapers/show/1


    After .htaccess enabled my above links look like this with working and not-working:

    http://www.*****.com/test/members (Working)
    http://www.*****.com/test/contact (Working)
    http://www.*****.com/test/3D-1/ (Not working 404 error)
    http://www.*****.com/test/Blue_Hills-1.html (Not working 404 error)

    Please help as my vendor is no more available.

    What changes should I make to the above code? I think I am missing something relating to subdirectory
     
    hitagent, Sep 22, 2008 IP
  2. The Universes

    The Universes Peon

    Messages:
    187
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What you should do is put the original htaccess in the /test/ folder and not your main folder.
     
    The Universes, Sep 23, 2008 IP
  3. hitagent

    hitagent Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I have the .htaccess placed in the /test folder.

    I have also tried it by installing the whole script outside the sub-directory and in the main directory but still the problem is same.

    I should add that I am on a Shared Godaddy server. I am telling because going through many other posts relating to htaccess in this forum I found out that godaddy handles htaccess in a different way.
     
    hitagent, Sep 26, 2008 IP