I got this when doing a little SEO today and have no idea how to fix it. What I currently have is: http://www.domain.com/page.php?blogid=17 and this is how the blog is found and displayed obviously the 17 is different depending on which article they want to view. How do I Rewrite links to work without using querystrings? I assume to look something like: http://www.domain.com/page/17 or any other way anyone knows how to do it. Thank you in advance.
Dynamically Generated URL http://www.domain.com/page/blogid/[VALUE]/ After converting your dynamic URL http://www.domain.com/page/blogid/17/ Create a .htaccess file with the code below The .htaccess file needs to be placed in http://www.domain.com/ Options +FollowSymLinks RewriteEngine on RewriteRule page/blogid/(.*)/ page.php?blogid=$1
Ok I put: Options +FollowSymLinks RewriteEngine on RewriteRule viewblog/blogid/(.*)/ viewblog.php?blogid=$1 into my .htaccess file and when clicking on a blog title to go to a blog it still shows format as: http://www.mofikiworldwide.com/viewblog.php?blogid=12 is there something that i'm doing wrong?
You have to set your blog-software to use the same format as you have in the .htaccess file. How you change it depends on what software you´re using.
My blog is written from scratch (I wrote the scripts myself) So what your saying is once its setup like it is above I would use http://www.mofikiworldwide.com/viewblog/blogid/12/ as the link and it will still use 12 as the value for the blogid variable as if it was http://www.mofikiworldwide.com/viewblog.php?blogid=12?
The you have to edit the code so it generates the links in the new style.. .htaccess will NOT do it for you..
Any chance there is example somewhere that you could show me. I am pretty good at PHP but this is giving me one heck of a time. I am so frusterated with it that I am seriously forgetting to end lines ; lol
Find the code part where it say href="http://www.mofikiworldwide.com/viewblog.php?blogid=$id PHP: and alter it to say href="http://www.mofikiworldwide.com/viewblog/blogid/$id/ PHP: this should be done on all places where your php generates the links..