Reply
URL's with .htaccess?
Old 09-13-2007, 10:32 AM URL's with .htaccess?
feraira's Avatar
BeTheBand!

Posts: 313
Hey guys, im wondering how I can go about this. I have URLs which are like:
www.domain.com/script.ext?something_id=3

I want to be able to make it so that the URL turns into something like this:
www.domain.com/script/something/name_of_thing if you understand that?

real world example:
www.hotcasket.com/tutorial.php?tutID=1

turn into

http://hotcasket.com/tutorial/Hello%20world!
__________________
www.alldrumtabs.com
feraira is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 09-13-2007, 03:41 PM Re: URL's with .htaccess?
dansgalaxy's Avatar
Eat, Sleep, Code

Posts: 6,049
Name: Dan
Location: Swindon
You use mod_rewrite

Code:
RewriteEngine On
RewriteBase /
 
RewriteRule ^PAGE/(.*)/$                 /PAGE.php?id=$1       [NC,L]
RewriteRule ^PAGE/(.*)$                  /PAGE.php?id=$1       [NC,L]
Add this to you .htaccess

and for each page you want to do this on you have to add
Code:
RewriteRule ^PAGE/(.*)/$                 /PAGE.php?id=$1       [NC,L]
RewriteRule ^PAGE/(.*)$                  /PAGE.php?id=$1       [NC,L]
for each page.

Then have your navigation and links pointing to the page/somethign urls

The only real benifit i find about this is Search Engine Friendly.

Hope this helps,
Talkupation Apprieciated
Dan
__________________
Personal UK Webhosting
Get 25% of ANY shared package for life ~ Promo: webmaster-talk (only for members!)
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Reply     « Reply to URL's with .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

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




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11831 seconds with 13 queries