Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 30th, 2006, 9:48 PM   #1
Makaveli19
Newbie
 
Join Date: Mar 2006
Posts: 1
Rep Power: 0 Makaveli19 is on a distinguished road
Apache Mod Rewrite Help

Hello,

I was hoping somebody can help me. This mod rewrite for my auction site. It works great, however I was wondering if it's possible to remove the "Category/" part before each url.

With the mod rewrite the urls look like this http://www.mysite.com/Category/Cell_Phones/

I was just hoping there is a way to remove the "Category" part of the url so that the urls would read like this http://www.mysite.com/Cell_Phones/

Is this possible with the rule below? I have tried but was unsuccessful. I got it to the point where everything was working except the CSS and images weren't appearing. Can someone help? Thanks in advance!

# Browse auction
RewriteRule ^Category/.*/[^/]+\_([0-9]+).html+$ index.php?a=1002&b=$1

# Browse auctions by category
RewriteRule ^Category/([^/]+/?[^/]+)/$ index.php?a=1005&b=$1&c=
RewriteRule ^Category/([^/]+/?[^/]+)/\?Browse=([^&]+)$ index.php?a=1005&b=$1&c=$2
RewriteRule ^Category/.*((images|css)/[^.]+\.[a-z]+)$ $1
RewriteRule ^Category/.*/([^/]+\.[a-z]+)$ $1
Makaveli19 is offline   Reply With Quote
Old Apr 19th, 2006, 1:29 AM   #2
BeachBum
Newbie
 
Join Date: Apr 2006
Posts: 1
Rep Power: 0 BeachBum is on a distinguished road
Writing the ModRewrite rules is the easy part, you would use something like:
RewriteRule ^/.*/[^/]+\_([0-9]+).html+$ index.php?a=1002&b=$1

the rules are ignoring the "Category" part of the string anyway. The more difficult task would be getting the site to leave the "Category" off of every URL string.

For SEO purposes this is a good idea as spiders will find the page closer to the root and therefore expect it to be of higher value.

-Travis
http://www.bestcodingpractices.com
BeachBum is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:38 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC