I need to change my httpd.conf from apache hosted in a shared server. I
need it to be a virtual server, and for that I need to add the
following lines:
PHP Code:
<VirtualHost *> DocumentRoot /home/totally/public_html ServerAdmin webmas...@mydomain.com ServerName mydomain.com ServerAlias *.mydomain.com User username Group username RedirectMatch 301 (.*) http://mydomain.com$1 </VirtualHost>
My host doesn't want to change the file, so, I wolud really appreciate
if someone could help me to change it from php
don't believe you can with PHP (never tried it though)
But even if you could edit it, have you the access to to restart the Apache server ? because httpd.conf is only read and implemented on server startup.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares? Code Samples | People Counting System
What exactly are you trying to do? You already have an entry like that for your site in the httpd.conf file, that is how your site is able to be displayed when somebody types your domain.
You can modify or change certain peices of the virtual host entry using a .htaccess file in the root of your website. Let us know exactly what you want to acheive and we'll tell what to put in the file. Judging by your post, it looks like you want to setup a RedirectMatch, is this correct?
Your host is the only one who can set this up for you. If they are unwilling then there really is nothing you can do. It's not just the apache conf file that needs to be modified, your DNS zone file needs to be changed as well.
« Reply to I have a problem with httpd.conf of Apache and need to change it with PHP