.htaccess question

10,910

chown the file(.htaccess) to set the owner to PHP's user, then chmod 755 That should do the trick :)

Plus you want: RewriteEngine On see below

RewriteEngine on
RewriteBase /
RewriteCond $1 !^(#(.)|\?(.)|.buildpath(.)|.svn\/(.)|admin.php(.)|content\/(.)|download.php(.)|images\/(.)|index.php(.)|install\/(.)|login.php(.)|readme.txt(.)|robots.txt(.)*)
RewriteRule ^(.+)$ index.php?url=$1 [L]
Share:
10,910
joe
Author by

joe

Updated on June 04, 2022

Comments

  • joe
    joe almost 2 years

    I am working on pinnacle cart - but the thing is that when i am trying to set "Enable flat URLs generation", it says:

    Please note: Error writing '.htaccess' file. Please check file permissions.

    I am not sure which permission it should be. I know it need to have mod_rewrite working as well. I am not familiar with .htaccess and mod_rewrite.

    chmod 644 .htacesss doesn't work at all. So I am guessing if i don't do anything with mod_rewrite, then .htaccess isnt working?

    i did: chown root .htaccess chown 644 .htaccess

    example:

    RewriteEngine   On
    RewriteBase     /
    RewriteCond     $1 !^(\#(.)*|\?(.)*|\.buildpath(.)*|.svn\/(.)*|admin\.php(.)*|content\/(.)*|download\.php(.)*|images\/(.)*|index\.php(.)*|install\/(.)*|login\.php(.)*|readme\.txt(.)*|robots\.txt(.)*)
    RewriteRule     ^(.+)$ index.php?url=$1 [L]
    

    One problem is that it will cause the .html to be down online. so do i have to add "*|home\.html(.)*"?

    Please give me insight on this and thank you

  • joe
    joe over 13 years
    PHP's user? did you mean root? Sorry I am not too familiar with terminology. I did turn rewriteEngine on but .html is down. So i am guessing that I need to add in .html?
  • Lightness Races in Orbit
    Lightness Races in Orbit about 13 years
    @Josephine: No, not root. root should have absolutely nothing to do with this. PHP's usergroup is possibly webuser and it'll be running as apache in most cases. So I'd chown apache:webuser .htaccess; chmod 755 .htaccess to give write access to the Apache user.