PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
[text]I have created search engine friendly URL's from my dynamic ones so "/index.php?page=home" now displays as "/index/page/home", is there are way of getting it to work with "/home" instead[/text]
<ul class="menu">
<a href="/dev/index/page/home">Home</a> <img src="images/present.png" height="38" width="35" alt="Logo"/>
<a href="/dev/index/page/hints">Hints & Tips</a> <img src="images/present.png"height="38" width="35" alt=" logo"/>
<a href="/dev/index/page/occasions">Occasions</a> <img src="images/present.png" height="38" width="35"alt=" logo"/>
<a href="/dev/index/page/blog">Blog</a> <img src="images/present.png" height="38" width="35"alt=" logo"/>
<a href="/dev/index/page/about">About</a>
</ul>
<br>
<?php
$page = $_GET['page'];
switch($page)
{
case('home'):
include ("home.php");
break;
case('about'):
include ("about.php");
break;
case('occasions'):
include ("occasions.php");
break;
case('blog'):
include ("blog.php");
break;
case('hints'):
include ("hints.php");
break;
default:
include ("home.php");
}
?>
[text]I have looked into the HTML Base tag, but not sure where to start, any help would be appreciated thanks[/text]
Last edited by werendle on Sun Dec 19, 2010 11:00 am, edited 1 time in total.
Hi Jonah, thanks for the reply, maybe I am missing something or have asked the wrong question.
with the current rewrite I have changed the displaying url from http://www.mydomain.com/index.php?page=home to http://www.mydomain.com/index/page/home which is much more friendly to the user, but what I am looking to achieve is http://www.mydomain.com/home. is it possible to use the mod rewrite to remove the /index/page/ from the url altogeather?
Thanks again for your help, Regards Will
Hi again, I have tried the change suggested, each link then returns the default case from indexp.php, I then tried changing the href link removing the /page/index and still no joy. Any other sugestions? many thanks again