Possible to change DNS setting and apache configuration file with php

Discussion in 'PHP' started by pradipkeya, Aug 18, 2008.

  1. #1
    Hi ,
    I need to map one of my folder for one domain as document root. Is it possible doing this change in configuration with the help of php file.

    I seek help asap. As this is very urgent.

    Thanks in advance,
    Pradip
     
    pradipkeya, Aug 18, 2008 IP
  2. jack_ss

    jack_ss Guest

    Messages:
    94
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You cannot edit your vhosts file from PHP. However, you can do a redirects with PHP
    <?
    Header( "HTTP/1.1 301 Moved Permanently" );
    Header( "Location: http://www.new-url.com" );
    ?> 
    PHP:
    or create a .htaccess file in your folder with the following:
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]
    Code (markup):
     
    jack_ss, Aug 18, 2008 IP
  3. pradipkeya

    pradipkeya Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi Sorry for late reply. Anyway thank your for your answer. I am trying to find out some other solution. If I get I will mentioned it here.

    Thanks for all your support,
    Pradip
     
    pradipkeya, Oct 12, 2008 IP