How to allow .htaccess file

Discussion in 'General' started by Skprorok, Jun 22, 2009.

  1. Skprorok

    Skprorok New Member

    Can someone tell me step by step how to allow .htaccess file? I need it for mod-rewrite.

    Thank you:)
     
  2. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    This is allowed and configured by default, no changes nescessary.
     
  3. Skprorok

    Skprorok New Member

    Thank for answer, but when I copy .htaccess file to /web10/ folder and refresh page, I get Internal server error.
     
  4. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    Then check the exact error message in the error message of the logfile. I'am sure that your .htaccess file contains other settings beside mod_rewrite rules.
     
  5. Skprorok

    Skprorok New Member

    But when i copy .htaccess to /web10/web/ directory, I can't see it in the dir. It will disappear.

    .htaccess file contains only mod_rewrite rules.s
     
  6. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    The is there and uploaded correctly but your FTP client or pureftpd hides hidden files (files that start with a dot). Take a look at the settings of the ftp client and the pureftpd configuration file.
     
  7. Skprorok

    Skprorok New Member

    Mustn't I allow mod-rewrite in Apache directives when I'm adding a website?
     
  8. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    No. Mod_rewrite is alaways enabled. But this has nothing to do with your original problem.
     
  9. Skprorok

    Skprorok New Member

    my .htaccess file contains this:

    RewriteEngine On
    RewriteRule ^uzivatel/(.*) /index.php?id=8&user_name=$1 [QSA]
    RewriteRule ^(.*)/(.*).xml /index.php?id=$1 [QSA]

    Where is error log of the website?
     
  10. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    In the log directory of the website.
     
  11. Skprorok

    Skprorok New Member

    Log directory? I have only log file there. But it is empty
     
  12. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    If the error.log file is empty then there are no errors. Check on the shell with the "ls -la" command if you placed the .htaccess file in the correct directory, the "web" directory.
     
  13. Skprorok

    Skprorok New Member

    Yes. It is in the correct "web" directory. i can access it with command
    nano /var/www/client/client0/web10/web/.htaccess
     
  14. Skprorok

    Skprorok New Member

    And it isn't "error.log" file but only "log" file in the /var/www/clients/client0/web10/log
     
  15. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    And you are sure that this .htaccess works? Have you tested it on another server successfully. In most scripts you have something like "RewriteCond ...." before the rules.
     
  16. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    log is a directory and not a file. Go into the log directory, there is the error.log file.
     
  17. Skprorok

    Skprorok New Member

    .htaccess works on another servers.

    I went to "error.log" file and i found errors:
    "RewriteEngine is not allowed here"

    What now?
     
  18. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    Remove the rewrite engine line as the rwrite engine is enabled already. If this wont work, simply copy the whole content of the .htaccess file into the apache directives field of the site and then delete the .htaccess file.
     
  19. Skprorok

    Skprorok New Member

    What if it still doesn't work?
     
  20. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    And you have tested this exact .htaccess file on another server without doing any modifications in it and you do not receibve any error messages in the error log anymore?
     
: .htaccess

Share This Page