mrkryz

Member
Nov 13, 2003
14
0
151
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.
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
33
473
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.
 

mrkryz

Member
Nov 13, 2003
14
0
151
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?
 

mrkryz

Member
Nov 13, 2003
14
0
151
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 ?