harleyflh75
04-04-2008, 07:58 PM
I have been working on this project for a few months now. it is similar to a cms and have most of it done except for SEF urls.
every page I have starting out with index.php that includes my session start, classes, config variables, templates with css et al.
an example of a link would be:
example.com/index.php?content=shop&task=viewcart&id=3
or
example.com/index.php?content=frontpage
plus there could be any number of POST variables
What would be the proper way to make this SEF?
1. for example this is a form action:
<form action="index.php?content=shop&category=<?php echo $_GET['category']; ?>" method="post" enctype="application/x-www-form-urlencoded" name="addtoCart">
Do I take this url of example.com/index.php?content=shop&category=2 and change it with a function to say example.com/shop/2 (or the name) then mod rewrite in htaccess back to example.com/index.php?content=shop&category=2. so it shows in the browser as /shop/2. and also do i retain all my POST variables.
2. Is it the oposite way to make this happen.
3. Am I totally off base with this mod rewrite.
Every site I have tried to find the answer is either geared toward Joomla SEF or just talks about the htaccess and not what to do prior to that.
as far as me using index.php everytime this is how this project started out. version 2.? will be different since I have learned classes since I started it.
I know this is probably hard to understand so it might be easier to answer individual questions.
Thanx in advance for the help.
every page I have starting out with index.php that includes my session start, classes, config variables, templates with css et al.
an example of a link would be:
example.com/index.php?content=shop&task=viewcart&id=3
or
example.com/index.php?content=frontpage
plus there could be any number of POST variables
What would be the proper way to make this SEF?
1. for example this is a form action:
<form action="index.php?content=shop&category=<?php echo $_GET['category']; ?>" method="post" enctype="application/x-www-form-urlencoded" name="addtoCart">
Do I take this url of example.com/index.php?content=shop&category=2 and change it with a function to say example.com/shop/2 (or the name) then mod rewrite in htaccess back to example.com/index.php?content=shop&category=2. so it shows in the browser as /shop/2. and also do i retain all my POST variables.
2. Is it the oposite way to make this happen.
3. Am I totally off base with this mod rewrite.
Every site I have tried to find the answer is either geared toward Joomla SEF or just talks about the htaccess and not what to do prior to that.
as far as me using index.php everytime this is how this project started out. version 2.? will be different since I have learned classes since I started it.
I know this is probably hard to understand so it might be easier to answer individual questions.
Thanx in advance for the help.