Page 1 of 1

SEO URL - infinite loop issue

Posted: Sat Dec 11, 2010 9:07 am
by werendle
[text]
Hi, I am trying to make my dynamic URL's search engine friendly, I have added the .htacces file with the following which I found on this site, Thank you for the help with that :D
[/text]

Code: Select all

RewriteEngine On
RewriteRule index/(.*)/(.*) index.php?$1=$2
[text]
which does work nicely with the following PHP code in my index.php
[/text]

Code: Select all

<ul class="menu">
	<a href="index/page/home">Home</a> &nbsp;&nbsp;&nbsp;&nbsp;<img src="images/present.png" height="38" width="35" alt="logo"/>&nbsp;&nbsp;&nbsp;&nbsp;
	<a href="index/page/hints">Hints & Tips</a> &nbsp;&nbsp;&nbsp;&nbsp;<img src="images/present.png"height="38" width="35" alt="logo"/>&nbsp;&nbsp;&nbsp;&nbsp;
	<a href="index/page/occasions">Occasions</a> &nbsp;&nbsp;&nbsp;&nbsp;<img src="images/present.png" height="38" width="35"alt="logo"/>&nbsp;&nbsp;&nbsp;&nbsp;
	<a href="index/page/blog">Blog</a>&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/present.png" height="38" width="35"alt="logo"/>&nbsp;&nbsp;&nbsp;&nbsp;
	<a href="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;
				 
			}
?>
[text]
My issue is the URL keeps growing, so after a few clicks on the menu items i end up with index/page/index/page/index/page/index/page/occasions. Additionally it seems to kill the formatting I have created in my style.css file.
Any help or suggestions would be much appreciated
[/text]

Re: SEO URL - infinite loop issue

Posted: Sat Dec 11, 2010 9:21 am
by s.dot
Try changing your links from "index/page/home" to "/index/page/home"

or adding an HTML base tag

Re: SEO URL - infinite loop issue

Posted: Sat Dec 11, 2010 9:34 am
by werendle
[text]Hi s.dot, awesome, thanks for such a quick reply, that has sorted the loop url issue[/text]