C
Ckoch
Guest
mod_layout Troubles (Fixed, see for details)
Hello,
I can get mod_layout installed, but it only seems to be functioning on html files. That is slightly disappointing to me. I'd like to force ads on every client's web site (We do free hosting), and many people now use PHP.
We'd still like to offer PHP of course, I was just wondering if anyone had come up with a creative way to solve this problem.
Thanks!
Christopher Koch
//+++++++FIXED+++++++\\
//+++++FOLLOWUP+++++\\
Hello,
Today I finally came across a solution that has nothing to do with .htaccess or mod_layout, and you can force ads on php and html files without issue.
Step One:
Go into your php.ini file, and find 'auto_prepend_file ='. Put the path to the file you wish to force into that variable. Also change output_buffering from off to 4096. Save, and exit.
Step Two:
Go into your httpd.conf and change the AccessFileName to something other than .htaccess (Something unexpected, such as, .you.cant.touch.this or something of the like, heh)
Step Three:
Edit your /etc/mime.types file and add in the following line
Make sure html and htm files aren't already being used by another type. This basically makes forces php to parse these files.
Step Four:
Restart httpd (service httpd restart), and there you have it. Your ad document will be shown on top of every single web site that you host. You can probably use your new .htaccess file (.you.cant.touch.this in my case) to stop ads from displaying on certain sites, but only with those you trust not to give out the name of the file. In my case, I use plesk, which you can force individual php and httpd settings on each domain, so no .htaccess uage at all.
No mod_layout. No worrying about clients screwing with .htaccess. There is probably some improvement to do here, but it should work for just about everyone. I tested this out on a Plesk 8.0 server, and it worked fine where mod_layout completely and utterly failed.
-Ckoch
Hello,
I can get mod_layout installed, but it only seems to be functioning on html files. That is slightly disappointing to me. I'd like to force ads on every client's web site (We do free hosting), and many people now use PHP.
We'd still like to offer PHP of course, I was just wondering if anyone had come up with a creative way to solve this problem.
Thanks!
Christopher Koch
//+++++++FIXED+++++++\\
//+++++FOLLOWUP+++++\\
Hello,
Today I finally came across a solution that has nothing to do with .htaccess or mod_layout, and you can force ads on php and html files without issue.
Step One:
Go into your php.ini file, and find 'auto_prepend_file ='. Put the path to the file you wish to force into that variable. Also change output_buffering from off to 4096. Save, and exit.
Step Two:
Go into your httpd.conf and change the AccessFileName to something other than .htaccess (Something unexpected, such as, .you.cant.touch.this or something of the like, heh)
Step Three:
Edit your /etc/mime.types file and add in the following line
Code:
application/x-httpd-php html htm
Step Four:
Restart httpd (service httpd restart), and there you have it. Your ad document will be shown on top of every single web site that you host. You can probably use your new .htaccess file (.you.cant.touch.this in my case) to stop ads from displaying on certain sites, but only with those you trust not to give out the name of the file. In my case, I use plesk, which you can force individual php and httpd settings on each domain, so no .htaccess uage at all.
-Ckoch