FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Pagination with .html extension





AOP Web Development
Hello guys and gals. do you have any idea regarding in pagination of php that html generated i mean i see some site that they use 1.html,2.html,3.html
i know that is a dynamic styles others i see that they use directory style like
www.example.com/example/page/1, www.example.com/example/page/2,
www.example.com/example/page/3, www.example.com/example/page/4

Do you have any idea regarding of that? I'm just curios and ofcourse i want to do that as to upgrade my pagination. Thanks in advance! Very Happy Very Happy
snowboardalliance
Yes, I have an idea of what your talking about. But what do you want to do exactly? I'm not sure if I understand, do you just want .html to work as .php? Or does this have to do with pagination? Or something else?
AOP Web Development
What i mean is instead of outputing this on the address bar

www.example.com/index.php?cat=category&dir=01

it will change supposed on

www.example.com/index/category/01


or it goes like this

www.example.com/category-01.html


Just like if you notice on this forum i know that this is a dynamic pagination but if you will see the url it will only appear http://www.frihost.com/forums/vf-14.html this is for the PHP AND MYSQL CATEGORY i just like to know how to do it?

i try to seach in google and they said that you can use mod_rewrite on apache, but i don't know if that is!
snowboardalliance
AOP Web Development wrote:
...
i try to seach in google and they said that you can use mod_rewrite on apache, but i don't know if that is!


Yeah mod_rewrite is correct in that case. I haven't done it myself so you can wait for another person to post or just google some more.
mathiaus
You need this
Code:
RewriteBase /
RewriteRule ^\.htaccess$ - [F]



To use www.example.com/index/category/01
Code:
RewriteRule ^index/category/(.*)$ /index.php?cat=category&dir=$1



To use www.example.com/category-01.html
Code:
RewriteRule ^category-(.*).html$ /index.php?cat=category&dir=$1

I haven't tested this one but it should work!
AOP Web Development
mathiaus wrote:
You need this
Code:
RewriteBase /
RewriteRule ^\.htaccess$ - [F]



To use www.example.com/index/category/01
Code:
RewriteRule ^index/category/(.*)$ /index.php?cat=category&dir=$1



To use www.example.com/category-01.html
Code:
RewriteRule ^category-(.*).html$ /index.php?cat=category&dir=$1

I haven't tested this one but it should work!



May i know how to implement that ? Where shall i put that on PHP or in htaccess?, if htaccess i didn't try to do it.. but if you can give a full example for it, it would be great Smile
mathiaus
sorry. They are mod-rewite rules for .htaccess. Just stick it in!
Code:
RewriteBase /
RewriteRule ^\.htaccess$ - [F]
RewriteRule ^category-(.*).html$ /index.php?cat=category&dir=$1
Related topics
How to change extension php to html but the php script still
What file extension should I use ?
Add HTML signatures with images to ur email...GUIDE
Hide PHP file extension
Looking for MS Outlook Alternatives
Simple PHP script not working
PHP Math
.html using header/footer include script?
Web hosting
new to php: can I use php INSIDE html?
I need your help uploading home page
Question about a Fill out form.
Frontpage
Help Needed - URL format
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.