How to create .htaccess file?

Discussion in 'Site & Server Administration' started by arunmaniaswin, Jun 24, 2010.

  1. #1
    Last edited: Jun 24, 2010
    arunmaniaswin, Jun 24, 2010 IP
  2. madaboutlinux

    madaboutlinux Member

    Messages:
    250
    Likes Received:
    7
    Best Answers:
    2
    Trophy Points:
    43
    #2
    You should already have a .htaccess file under /home/aranand/public_html directory. Goto 'File Manager' from cPanel and select the option to view hidden files.
     
    madaboutlinux, Jun 24, 2010 IP
  3. abiko

    abiko Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes, madaboutlinux pointed it out, you should be also able to view it if you login into your account via FTP.
    If there isn't a .htaccess file, simply create one file on your computer named ".htaccess" and upload it to the public_html folder.

    If you do have a subdomain and it needs it's own .htaccess file, simple place a new .htaccess file in the subdomains directory - Apache will not process the main .htaccess (in the public_html) if there is a .htaccess in the subdomain folders everytime it is opened your subdomain.
     
    abiko, Jun 24, 2010 IP
  4. arunmaniaswin

    arunmaniaswin Well-Known Member

    Messages:
    129
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    125
    #4
    i know to create blank .htaccess file.
    i want to to create the .htaccess file so that the above mentioned problem will be solved.
    help me to solve it.


    regards
    arunmani
     
    arunmaniaswin, Jun 24, 2010 IP
  5. abiko

    abiko Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Can you post the .htaccess in the public_html, so we can check if there are any RewriteRules that might be interfering with the subdomain ?
     
    abiko, Jun 24, 2010 IP
  6. arunmaniaswin

    arunmaniaswin Well-Known Member

    Messages:
    129
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    125
    #6
    following code is written in the .htaccess file located in the Public_html folder:

    <IfModule mod_suphp.c>
    suPHP_ConfigPath /home/aranand
    <Files php.ini>
    order allow,deny
    deny from all
    </Files>
    </IfModule>

    whether the above code cause the problem i mentioned??
     
    arunmaniaswin, Jun 24, 2010 IP
  7. manish.chauhan

    manish.chauhan Well-Known Member

    Messages:
    1,682
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    110
    #7
    As you mention that your website is redirecting to some other page, it simply means that there is already some redirection in place. I would like you to share the code of htaccess file
     
    manish.chauhan, Jun 24, 2010 IP
  8. arunmaniaswin

    arunmaniaswin Well-Known Member

    Messages:
    129
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    125
    #8
    actually their is no .htaccess file in that sub-domain.(at http://tamilmp3online.orutube.com)
    kindly let me know, if u can create one for that.
    the application installed in the sub-domain is musicboxv2.com
     
    arunmaniaswin, Jun 25, 2010 IP
  9. manish.chauhan

    manish.chauhan Well-Known Member

    Messages:
    1,682
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    110
    #9
    I got the point, do you have full access of your website. If yes than check if there is header redirection set on your index page. or send me code of your index file.
     
    manish.chauhan, Jun 25, 2010 IP
  10. arunmaniaswin

    arunmaniaswin Well-Known Member

    Messages:
    129
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    125
    #10
    hi,
    here i'm unable to attach the index.php with this post.
    anyway i zipped it and uploaded it in http://tamilmp3online.orutube.com/index.zip

    kindly download and check it...also let me know whats the problem.

    thanks in advance.

    regards
    arunmani
     
    arunmaniaswin, Jun 25, 2010 IP
  11. manish.chauhan

    manish.chauhan Well-Known Member

    Messages:
    1,682
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    110
    #11
    I am not able to access this zip file.
     
    manish.chauhan, Jun 27, 2010 IP
  12. dom19

    dom19 Active Member

    Messages:
    344
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    53
    #12
    Me too :)... 404
     
    dom19, Jun 27, 2010 IP
  13. josephwaldman1984

    josephwaldman1984 Peon

    Messages:
    306
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #13
    # To redirect all users to access the site WITH the www. prefix,
    # (http://example.com/... will be redirected to http://www.example.com/...)
    # adapt and uncomment the following:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\.mt-example\.com$ [NC]
    RewriteRule ^(.*)$ http://www.mt-example.com/$1 [L,R=301]
     
    josephwaldman1984, Jun 27, 2010 IP
  14. josephwaldman1984

    josephwaldman1984 Peon

    Messages:
    306
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #14
    # To redirect all users to access the site WITH the www. prefix,
    # (http://example.com/... will be redirected to http://www.example.com/...)
    # adapt and uncomment the following:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\.mt-example\.com$ [NC]
    RewriteRule ^(.*)$ http://www.mt-example.com/$1 [L,R=301]
     
    josephwaldman1984, Jun 27, 2010 IP