0

Hi Brothers,

I m completely new at PHP, i dont know anything about php
but from different sites i have come to know that i can redirect my unfriendly url to friendly urls. so i have started a short project but i dont know how to make url writing plz guide me.

I have 2 pages, 1)Index.php 2)cats.php
source code is for index.php is

<html>
<body>

<p><a href="http://www.example.com/cats.php?cat=1">category1</a></p>
<p><a href="http://www.example.com/cats.php?cat=2">category2</a></p>
<p><a href="http://www.example.com/cats.php?cat=3">category3</a></p>
<p><a href="http://www.example.com/cats.php?cat=4">category4</a></p>
<p><a href="http://www.example.com/cats.php?cat=5">category5</a></p>
<p><a href="http://www.example.com/cats.php?cat=6">category6</a></p>

</body>
</html>

----------------------------------------------------------------------
and the source code for cats.php is

<html>
<body>
<?php
$txt=$_GET['cats'];
echo $txt;

?>
</body>
</html>

-----------------------------------------------------------------------------

I want to redirect
http://www.example.com/cats.php?cat=1
http://www.example.com/cats.php?cat=2
http://www.example.com/cats.php?cat=3

to

http:/www.example.com/cats/1
http://www.example.com/cats/2
http://www.example.com/cats/3

i have also updated .htaccess file by code provided by seochat.com from url rewriting code section


please tell me or provide me source files so i can make url rewriting

Edited by Ezzaral: Added [code] [/code] tags. Please use them to format any code that you post.

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by Will Gresham
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.