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.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
.htaccess for Friendly URLs... PLEASE HELP!
Old 01-08-2010, 04:01 AM .htaccess for Friendly URLs... PLEASE HELP!
Junior Talker

Posts: 4
Trades: 0
Hello everyone,

I am trying to rewrite my urls for better SEO reasons.
The script that i am using has a config.php file that I can set the Friendly URLs to "TRUE" and it actually does the trick for me but not the way I like it.

Currently the original url:
http://www.mysite.com/?cityid=-1&lang=en

is translated to:
http://www.mysite.com/-1_newyork/

I would like to modify this to only show the city name without the cityid. e.g.:
http://www.mysite.com/newyork/


Here is a copy of my .htaccess file

Code:
RewriteEngine On                                                                                                                              
 
                                                                                                                                              
 
# Show ad                                                                                                                                      
 
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/posts/([0-9]+)([-_][^/]*)?/([0-9]+)([-_][^/]*)?/([0-9]+)([-_][^/]*)?\.html      /index.php?view=showad&adid=$7&cityid=$1 [QSA] 
 
                                                                                                                                              
 
# Ads                                                                                                                                          
 
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/posts/([0-9]+)([-_][^/]*)?/([0-9]+)([-_][^/]*)?/page([0-9]*)\.html         /index.php?view=ads&catid=$3&subcatid=$5&cityid=$1&page=$7 [QSA] 
 
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/posts/([0-9]+)([-_][^/]*)?/([0-9]+)([-_][^/]*)?               /index.php?view=ads&catid=$3&subcatid=$5&cityid=$1 [QSA] 
 
                                                                                                                                              
 
# Ads by cat                                                                                                                                  
 
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/posts/([0-9]+)([-_][^/]*)?                        /index.php?view=ads&catid=$3&cityid=$1 [QSA] 
 
                                                                                                                                              
 
# Show event                                                                                                                                  
 
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/events(/(([0-9]+)-([0-9]+)-([0-9]+)))?/([0-9]+)([-_][^/]*)?\.html         /index.php?view=showevent&date=$4&adid=$8&cityid=$1 [QSA] 
 
                                                                                                                                              
 
# Events on date                                                                                                                              
 
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/events/(([0-9]+)-([0-9]+)-([0-9]+))/page([0-9]*)\.html            /index.php?view=events&date=$3&cityid=$1&page=$7 [QSA] 
 
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/events/(([0-9]+)-([0-9]+)-([0-9]+))                     /index.php?view=events&date=$3&cityid=$1 [QSA] 
 
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/events                              /index.php?view=events&cityid=$1 [QSA] 
 
                                                                                                                                              
 
# Show image                                                                                                                                  
 
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/images/([^/]+)/([0-9]+)([-_][^/]*)?\.html                  /index.php?view=showimg&posterenc=$3&imgid=$4&cityid=$1 [QSA] 
 
                                                                                                                                              
 
# Images by user, paged                                                                                                                        
 
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/images/([^/]+)/page([0-9]+)\.html                     /index.php?view=imgs&posterenc=$3&cityid=$1&page=$4 [QSA] 
 
                                                                                                                                              
 
# Top Images, paged                                                                                                                            
 
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/images/page([0-9]+)\.html                        /index.php?view=imgs&cityid=$1&page=$3 [QSA] 
 
                                                                                                                                              
 
# Images by user                                                                                                                              
 
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/images/([^/]+)                           /index.php?view=imgs&posterenc=$3&cityid=$1 [QSA] 
 
                                                                                                                                              
 
# Top Images                                                                                                                                  
 
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/images                              /index.php?view=imgs&cityid=$1 [QSA] 
 
                                                                                                                                              
 
# Quick ad/event/image                                                                                                                        
 
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/showpost/([0-9]+)([-_][^/]*)?\.html                     /index.php?view=showad&adid=$3&cityid=$1 [QSA] 
 
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/showevent/([0-9]+)([-_][^/]*)?\.html                     /index.php?view=showevent&adid=$3&cityid=$1 [QSA] 
 
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?/showimage/([0-9]+)([-_][^/]*)?\.html                     /index.php?view=showimg&imgid=$3&cityid=$1 [QSA] 
 
                                                                                                                                              
 
# City/Region                                                                                                                                  
 
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?                                 /index.php?view=main&cityid=$1 [QSA] 
 
RewriteRule ^([-]?[0-9]+)([-_][^/]*)?                                 /index.php?view=main&cityid=$1 [QSA]

Any help would be really appreciated.
AVATARI is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-08-2010, 04:06 AM Re: .htaccess for Friendly URLs... PLEASE HELP!
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,381
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
I am trying to rewrite my urls for better SEO reasons
If that's your only reason. ... Don't bother.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-08-2010, 02:21 PM Re: .htaccess for Friendly URLs... PLEASE HELP!
Junior Talker

Posts: 4
Trades: 0
Quote:
Originally Posted by chrishirst View Post
If that's your only reason. ... Don't bother.

Why? Don't you think search engine friendly URLs can significantly help in gaining a better Google site rank and result more traffic? I keep reading about it on the internet that search engines and their crawlers like to index shorter, meaningful urls rather than those with a bunch of ID numbers and "?" or "=' symbols in them.
AVATARI is offline
Reply With Quote
View Public Profile
 
Old 01-08-2010, 04:02 PM Re: .htaccess for Friendly URLs... PLEASE HELP!
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,381
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Correct!

Not only do I not think so I know so.

It's just a fallacy that search engines "prefer" rhen.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-09-2010, 11:32 PM Re: .htaccess for Friendly URLs... PLEASE HELP!
Junior Talker

Posts: 4
Trades: 0
Quote:
Originally Posted by chrishirst View Post
Correct!

Not only do I not think so I know so.

It's just a fallacy that search engines "prefer" rhen.

Well, I understand that search engines have already abandoned the use of keywords for page indexing and ranking websites, and as your experience Friendly URLs don't do anything good either. So if mod_rewrite and using of keywords are out of the picture, then what would you suggest for better SEO?
AVATARI is offline
Reply With Quote
View Public Profile
 
Old 01-10-2010, 05:22 AM Re: .htaccess for Friendly URLs... PLEASE HELP!
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,381
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
"better SEO" what an odd phrase that is?


http://www.webmaster-talk.com/seo-ta...tml#post777529
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-11-2010, 07:03 PM Re: .htaccess for Friendly URLs... PLEASE HELP!
Junior Talker

Posts: 4
Trades: 0
Quote:
Originally Posted by chrishirst View Post
"better SEO" what an odd phrase that is?


http://www.webmaster-talk.com/seo-ta...tml#post777529

I agree, sounds geeky but hey, people use it all over the net:
http://www.google.com/search?q=bette...ient=firefox-a
AVATARI is offline
Reply With Quote
View Public Profile
 
Old 01-12-2010, 06:59 PM Re: .htaccess for Friendly URLs... PLEASE HELP!
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,381
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Aye. There are far too many people who have absolutely no idea what optimising actually means!!!
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to .htaccess for Friendly URLs... PLEASE 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.29391 seconds with 12 queries