.htaccess

This is a discussion on ".htaccess" within the PHP Forum section. This forum, and the thread ".htaccess are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Nov 13th, 2005, 09:09
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
.htaccess

hey guys

i have a forum i've written, and i want 2 do wat this forum does with the .htaccess stuff, and instead of having the url viewtopic.php?topicid=12, i want it to have the name-of-the-topic.html, like this forum does...

how can i do that? i noticed in the other post, rob showed a bit of code from .htaccess, but how wud i do that so that it gets the title of the topic from the database?

thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Nov 13th, 2005, 09:23
Rob's Avatar
Rob Rob is online now
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,194
Blog Entries: 7
Thanks: 27
Thanked 24 Times in 21 Posts
Re: .htaccess

Ben,

You need to code your application so that it writes out the url's the way you want.

The .htaccess rules just make sure that the non-existant URL's (when requested) are directed to your existing scripts.

Obviously, you'll be able to code the URL side, post when you need .htaccess help.
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Nov 13th, 2005, 22:27
Tim356's Avatar
Reputable Member
Join Date: Nov 2003
Location: Australia
Age: 26
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Re: .htaccess

You could always download the plugin that Rob did for the url converting, then have a good look at how they did it?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Nov 14th, 2005, 10:45
Rob's Avatar
Rob Rob is online now
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,194
Blog Entries: 7
Thanks: 27
Thanked 24 Times in 21 Posts
Re: .htaccess

Quote:
Originally Posted by Tim356
You could always download the plugin that Rob did for the url converting, then have a good look at how they did it?
Or dont.... it's a commercial script and as such the code is protected, obfuscated and un-readable.
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Nov 15th, 2005, 06:10
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Re: .htaccess

ok thanks rob
i can recode it to include the title, but then what to i actually link to in my <a href="blah"> etc? do i link to the php, will the .htaccess handle the rest? or do i need to link to the new .html url?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Nov 15th, 2005, 09:33
Rob's Avatar
Rob Rob is online now
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,194
Blog Entries: 7
Thanks: 27
Thanked 24 Times in 21 Posts
Re: .htaccess

Hi Ben.... link to the url as you want it to appear. The .htaccess file will push requests for that url at your php files.

It's a common misconception that .htaccess will change url's in scripts...... it wont. It will only perform operations on HTTP Requested URL's.... that is, your browser requests a url...... your server then does something with that url (re-writes it, forwards it, redirects it, rejects it(with error) )

You have to make all your URL's look pretty.... .htaccess will just make sure that http requests for the pretty versions are transfered across to your php file.

Hope that makes sense.
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Nov 15th, 2005, 16:23
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Re: .htaccess

yea it does, thank you, i'll give it a go
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
htaccess

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
writing htaccess alexgeek PHP Forum 12 Oct 9th, 2007 07:09
htaccess BarryM Web Page Design 3 Oct 27th, 2006 19:28


All times are GMT. The time now is 20:40.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved