Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Old 03-24-2005, 10:35 AM Mod rewrite help
Python's Avatar
Ultra Talker

Latest Blog Post:
A new site is launched
Posts: 374
Trades: 0
http://www.freewebmasterresources.net

I want to mod rewrite the URL's at that site so that they are more search engine friendly.


The current URL layout is:
http://www.freewebmasterresources.ne... IF Statements


Id like to convert the above to the following:
http://www.freewebmasterresources.ne...-IF-Statements

Anyone able to help?

Thanks
__________________

Please login or register to view this content. Registration is FREE

- Affordable web site design solutions
Python is offline
Reply With Quote
View Public Profile Visit Python's homepage!
 
 
Register now for full access!
Old 03-25-2005, 12:59 PM
simptech's Avatar
Skilled Talker

Posts: 81
Location: Cape Coral, Florida, United States
Trades: 0
try this in a htaccess file in your main folder...

Code:
RewriteEngine On
RewriteRule ^(.*)/(.*)$	/index.php?cat=$1&t=$2 [L]
however, i would suggest structuring the urls like "/unused/language/blah-blah-blah"

that way, you can make sure that it is only handed to the script like so...

Code:
RewriteEngine On
RewriteRule ^(articles|walkthroughs|etc)/(.*)/(.*)$	/index.php?cat=$2&t=$3 [L]
basically keeping the hand-off limited to certain urls and not ALL of them.
__________________

Please login or register to view this content. Registration is FREE

FREE PHP scripts for your website!

Last edited by simptech; 03-25-2005 at 01:04 PM..
simptech is offline
Reply With Quote
View Public Profile
 
Old 03-30-2005, 11:14 AM
Python's Avatar
Ultra Talker

Latest Blog Post:
A new site is launched
Posts: 374
Trades: 0
Ok it works.... but there is a problem...

If the topic hasnt been selected(otherwords there is no $t variable and just a category) then the content doesnt show..

e.g.:

This works: http://www.freewebmasterresources.ne...F%20Statements

This doesnt: http://www.freewebmasterresources.net/webmaster/ASP/

The second one isnt showing up the listings as it normally does when it is accessed by http://www.freewebmasterresources.net/index.php?cat=ASP

Should I just recode the script itself so that it extracts the category from the url and then uses that to get the right content from the db instead of using a variable to extract it... or is there another way?
__________________

Please login or register to view this content. Registration is FREE

- Affordable web site design solutions
Python is offline
Reply With Quote
View Public Profile Visit Python's homepage!
 
Old 03-30-2005, 11:38 AM
Python's Avatar
Ultra Talker

Latest Blog Post:
A new site is launched
Posts: 374
Trades: 0
ok... no worries... Ive sorted it now.. thanks
__________________

Please login or register to view this content. Registration is FREE

- Affordable web site design solutions
Python is offline
Reply With Quote
View Public Profile Visit Python's homepage!
 
Reply     « Reply to Mod rewrite help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 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.13497 seconds with 12 queries