|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Hello;
I programmed a system. I want to turn it to SEO but don't know what to do? for example one of my url is : http://localhost/project/?act=show_content&show_type=once&id=12 How can I change it to this : http://localhost/project/show_content/once/12 please guide me what I have to write in htaccess file and what should I do in my PHP codes? Should I change my links url basically? Thanks in advanced.... |
|
#2
|
|||
|
|||
|
Check this out
http://www.addedbytes.com/apache/mod_rewrite-cheat-sheet/ |
|
#3
|
||||
|
||||
|
Quote:
if you had a page like: http://localhost/project/yourpage.php?act=show_content&show_type=once&id=12 you could use: Code:
Options +FollowSymLinks RewriteEngine on RewriteRule yourpage/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/$ /project/yourpage.php?$1=$2&$3=$4&$5=$6 to rewrite this to friendly: http://localhost/yourpage/act/show_content/show_type/once/id/12/
__________________
When I die, I want to go peacefully like my Grandfather did, in his sleep -- not screaming, like the passengers in his car. |
|
#4
|
|||
|
|||
|
I did find a problem with this.
Using backslashes, the browser thinks the page is in all of those folders now. I don't use ./ when putting in images so it doesnt base everything from root. Instead of / I ended up using - symbols as a way around this.
__________________
- Richie |
|
#5
|
||||
|
||||
|
Thanks friends.
But In my php code what should I do? is it works automatically or I have to change my codes? another question : Why I don't have reputation button!? |
|
#6
|
||||
|
||||
|
Once the .htaccess file (assuming you are using apache) is setup correctly your PHP code should not have to be changed. Just change how it prints out any links, in template files etc.
__________________
Ubuntu User #13389 |
|
#7
|
|||
|
|||
|
That's true, for SEO purposes, it's also important how your inner pages are linked together, .htaccess is for only for spiders
|
![]() |
| Viewing: Codewalkers Forums > General > General Chat > All should I do for SEO |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|