Reputation: 103
i have few conceptual queries about moving a locahost site to server for making it available on internet.....what are the steps...how server will recognize the changes in my apache and php config files..i have built a website in php and mysql on apache 2.2
NOTES:
i have made some changes in my apache config files.one of them is i have included a fillename "index.php" in "DirectoryIndex"...so now my DirectoryIndex looks like:
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
so now automatically my apache tells the browser to search for a index.php file whenever header('LOCATION:') or refresh is called.and it's obvious that my index.php files holdas the html and and other php codes which will be shown or displayed
third and most importantly...i have used header function in many cases while building the website..my header functions are like header('Location: http://localhost/home/');
so repeating the question again
should i change all the header functions while uploading acording to my website name i.e
header('Location: http://www.my_site_name.com/home/');
in place of
header('Location: http://localhost/home/');
Upvotes: 2
Views: 1937
Reputation: 582
and who will my remote server will recognize the changes i have made in my config file and will work according to the changes
Normally hosting servers are configured to allow the use of .htaccess files to override apache configuration
you may create a .htaccess file in your root directory and place there your DirectoryIndex settings
Upvotes: 1
Reputation: 10219
should i change all the header functions while uploading acording to my website name i.e
header('Location: http://www.my_site_name.com/home/');
in place ofheader('Location: http://localhost/home/')
;
Why not using relative paths or simply:
header('Location: /home/');
and who will my remote server will recognize the changes i have made in my config file and will work according to the changes
That way, it'll work on both servers.
and what are the steps to upload a website to internet
You should use a FTP client to upload your website to your webhost.
Upvotes: 0