Help in understanding php links [closed]
My website has a structure l开发者_如何学Goike this: root folder contains --- > 1)index.php 2) Child Folder which also contain home.php, contact.php and products.php
Now I just created a new page called page.php (in the child folder) and made some changes to it so it becomes unique to only the homepage.
My question is, how do I change the the homepage link from the default home.php (in the child folder) to the page.php??
Do I have to create the link in the index.php
Please forgive my ignorance. To make the question simple, take it this way: How do I create a theme and make it unique to only a particular page say only the homepage or only the products page?? I've been very frustrated for weeks trying to customize my homepage
I can't really tell what you're asking. Are you trying to make it so that:
http://mywebsite.com/child-folder/
Resolves to this?
http://mywebsite.com/child-folder/page.php
If so, just put this in /child-folder/.htaccess
:
DirectoryIndex page.php
This isn't necessarly for PHP question.
You need to elaborate on your question a bit more. For example, are you trying to go to lets say www.examplesite.com and have it than point to the page.php page and have that be the homepage?
If so, you can do a PHP redirect with
header("Location: folder/page.php");
That needs to be in the header of the file or what I would do is alter it in .htaccess with RewriteRule:
RewriteCond %{HTTP_HOST} ^www\.exampleurl\.com$
RewriteRule (.*) http://www.exampleurl.com/folder/page.php
精彩评论