.htaccess failure - help!

Discussion in 'IP.Board Discussions' started by Noles, Jan 22, 2010.

  1. Noles

    Noles Adept

    Joined:
    Dec 2, 2009
    Messages:
    116
    Likes Received:
    10
    First Name:
    Ryan
    So I was experimenting with redirects and the .htaccess file... and I failed.

    Two things went wrong. First of all I tried to take the "www". out and redirect it to a URL that would just use "darkperfection" - or even vice versa but I just felt it was good to do something like that.

    So ok, just remove the file? I can't see it. When I try to upload the .htaccess, it just disappears. I didn't even see one before I added one to make the changes, so I just assumed I didn't have one until I realized that "darkperfection.org/forum" no longer redirected to my forum homepage.

    I use this link everywhere and it's really easy to type out. Could anyone educate me on how to change it back and keep my .htaccess file viewable? I am really at a loss at this point. From the link I posted above, from when I asked about one community, it worked when I tried it. I edited the textandshoot out and put in darkperfection and I guess it just does work the same for IPB 2.3 or maybe it's my host?

    :(
     
  2. Nick

    Nick Regular Member

    Joined:
    Jul 27, 2008
    Messages:
    7,441
    Likes Received:
    218
    I suspect this is the scenario: Your FTP program is configured to hide hidden files (.htaccess is considered a hidden file), so it appeared that the .htaccess file didn't exist. So you created one and inadvertently overwrote the original, which essentially "un-did" all of your edits/hacks.

    Consult the help documentation for your FTP client, and change your settings to display hidden files.

     
  3. Noles

    Noles Adept

    Joined:
    Dec 2, 2009
    Messages:
    116
    Likes Received:
    10
    First Name:
    Ryan
    Well I "fixed" it... but I seriously have no idea how.

    I entered this information in a .htaccess file and uploaded not to /forum, but to my root directory:

    - my textandshoot .htaccess file. What in the world?


    Well now for some reason main page is looking to index.html instead of index.php like it usually does. The results are not pretty.
     
  4. Vekseid

    Vekseid Regular Member

    Joined:
    Jun 2, 2009
    Messages:
    393
    Likes Received:
    13
    ...heh. Well, start simple. Get rid of the junk there and just use:

    Code:
    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} !^textandshoot\.com
    RewriteRule ^(.*)$ http://textandshoot.com$1 [L,R=301] 
    
    Note that the request parameter actually begins with the /. If you want to include that in the rewrite without messing things, you would instead use:
    RewriteRule ^/(.*)$ http://textandshoot.com/$1 [L,R=301]

    My code also redirects every request your site gets to that.

    To force index.php and only index.php to be called as the index file, use

    DirectoryIndex index.php

    I have no idea what you tried to do with the rest of that. Explain what your goals are and I can help : )
     
  5. Noles

    Noles Adept

    Joined:
    Dec 2, 2009
    Messages:
    116
    Likes Received:
    10
    First Name:
    Ryan
    Alright here's my problem, I need "www.darkperfection.org" to redirect to it's former page, the index.php - it now redirects to index.html (a test page I have) and if I delete it it will just look at the init.php and not the index.php.

    I do not have any problems with the textandshoot site, it's darkperfection.org I need the help with.

    If that can be fixed and I can get it back to normal, I'd also like to have this fixed:

    awww.adminaddict.net_data_MetaMirrorCache_201de3e2b35409092d992191ff4f4bba.png

    I think it's using my index.html instead of index.php because I put in that .htaccess file. Obviously I can't delete it either since I can't see it.
     
  6. Noles

    Noles Adept

    Joined:
    Dec 2, 2009
    Messages:
    116
    Likes Received:
    10
    First Name:
    Ryan
    Alright I configured it so I can see the files.
     
  7. Noles

    Noles Adept

    Joined:
    Dec 2, 2009
    Messages:
    116
    Likes Received:
    10
    First Name:
    Ryan
    Scratch that, it's supposed to be going to portal.php
     
  8. Vekseid

    Vekseid Regular Member

    Joined:
    Jun 2, 2009
    Messages:
    393
    Likes Received:
    13
    ...why can't you copy portal.php to index.php?
     
  9. Noles

    Noles Adept

    Joined:
    Dec 2, 2009
    Messages:
    116
    Likes Received:
    10
    First Name:
    Ryan
    Because I can't think this evening. :D

    Thanks so much.
     

Share This Page