The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

FrontPage Extensions & ModRewrite

Discussion in 'General Discussion' started by mrkryz, Sep 18, 2005.

  1. mrkryz

    mrkryz Member

    Joined:
    Nov 13, 2003
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    I have a cpanel server which I have a bit of a problem with...

    I need to use frontpage extensions and mod_rewrite together however the default "Install/Remove/Reinstall" extensions options writes a default .htaccess file which is missing the Options +FollowSymLinks as the last line in it which frontpage needs to work correctly. I located the Frontpage.pm which is called but that executes a binary cpwrap to writre the file and content. Any fixes for this?

    These files:
    /public_html/.htaccess
    /public_html/_vti_bin/.htaccess
    /public_html/_vti_bin/_vti_adm/.htaccess
    /public_html/_vti_bin/_vti_aut/.htaccess

    All those need Options +FollowSymLinks to be the last line in them as a default in order for fp to work w/mod_rewrite for the purpose of 301/302's. I am trying to avoid a homebrew script because my clients often uninstall/reinstall/install extensions on their own through cpanel.

    Ideally a default file that always has:
    #====================================================
    RewriteEngine on
    RewriteCond %{HTTP_HOST} !www.DOMAIN
    RewriteRule ^.*$ http://www.DOMAIN%{REQUEST_URI} [R=301,L]

    Options +FollowSymLinks
    #====================================================

    Would be great.
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    You could script it into /scripts/postwwwact to append that line to each of those .htaccess files if it's a frontpage site so that it is done automatically when you create a new account.
     
  3. mrkryz

    mrkryz Member

    Joined:
    Nov 13, 2003
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for the reply. I do not have a /scripts/postwwwact should I create one? and also how would I go about having it insert the correct domainname into the .htaccess? Is there a tag I coul use? {HTTP_HOST} etc?

    so if i just :

    echo "RewriteEngine on" >> /public_html/.htaccess
    echo "RewriteCond %{HTTP_HOST} !www.{HTTP_HOST}" >> /public_html/.htaccess
    echo "RewriteRule ^.*$ http://www.{HTTP_HOST}%{REQUEST_URI} [R=301,L]" >> /public_html/.htaccess

    echo "Options +FollowSymLinks" >> /public_html/.htaccess

    And also how to append to each .htaccess file in the _vti_bin, _vti_bin/_vti_adm, _vti_bin/_vti_aut, and public_html?
     
  4. mrkryz

    mrkryz Member

    Joined:
    Nov 13, 2003
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    One other quick question ... a postwwwact script would only run after an account creation yes/no? I would need it to run after any time that installfp or Frontpage.pm runs. Would it be easier to write a wrapper for Frontpage.pm? Like renaming Frontpage.pm to FrontpageOriginal.pm and have a new Frontpage.pm call it and then after execution then echo the lines I need ?
     
Loading...

Share This Page