Webmastersite.net
Register Log In

Thinking About Changing the Category Rewrite Path ..

Comments on Thinking About Changing the Category Rewrite Path ..

eeyipes
Member

Usergroup: Customer
Joined: Nov 12, 2004

Total Topics: 9
Total Comments: 20
eeyipes
Thinking About Changing the Category Rewrite Path ..
Posted Oct 02, 2012 - 10:05 AM:

I've noticed for a while now that pages with shorter urls seem to rank better with Google, especially pages that managed to get indexed with really short urls like mydomain.com/9999 instead of the usual category path. With the current default {CATREWRITEPATH}/{PAGE}.html scheme, I've noticed that for example that mydomain.com/coupon-codes/clothing/childrens-apparel/rascals-2-rockstars/ also works at mydomain.com/9999/rascals-2-rockstars/ or just mydomain/rascals-2-rockstars/

So I'm trying to decide what is the best way to shorten down my urls, and 301 redirecting the old ones to the new ones, without fudging everything up, and still keeping them categorized. I'd like to change the cat rewrite to {CATNAME}/{PAGE}.html , but I would have to make sure every category name is unique, which is fine with me. Or I could leave the rewrite path alone, and just use mydomain.com/{CATNAME} on site and let the bots pick it up from there, ammend the sitemap and try to create some 301 redirects that don't break everything.

Any thoughts or anything I should be aware of?

In preparation for a change I've made sure there are no special characters any of my {CATNAME}s and removed any specialurl redirects.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted Oct 02, 2012 - 6:30 PM:

Or I could leave the rewrite path alone, and just use mydomain.com/{CATNAME} on site

That would break on any category with a space in the name.

Testing {CATNAME} for category rewrites and {LINKCATNAME} for listing URLs. I see the vote and email pages break under this changed scheme, I'll fix that in 7.1.1.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted Oct 02, 2012 - 6:45 PM:

Okay seems to work now in the unreleased 7.1.1.
eeyipes
Member

Usergroup: Customer
Joined: Nov 12, 2004

Total Topics: 9
Total Comments: 20
eeyipes
Posted Oct 02, 2012 - 9:26 PM:

Cool... so the change to {CATNAME}/{PAGE}.html should be good? You mentioned {LINKCATNAME} -- are you suggesting that the link rewite path would have to change too?

As far a 301 redirect, which is better - a simple 301 redirect in the final category template, or should I fiddle with the htaccess and try for a complete folder rewrite?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted Oct 03, 2012 - 10:37 AM:

{CATNAME}/{PAGE}.html was what I tested with yes. You don't have to change {LINKREWRITEPATH} to {LINKCATNAME}, but if you want shorter URLs and for it to visually match the categories I assume you'd want to change that.

I'm not sure what you have in mind for an in-template 301 redirect -- maybe you're thinking of the 'bad request' template but I'm not sure it'll arrive there, it may be 404 pages. .htaccess is the only way I can think of that would work. Probably a fairly complex set of rules, I can write it for $30 if needed.
eeyipes
Member

Usergroup: Customer
Joined: Nov 12, 2004

Total Topics: 9
Total Comments: 20
eeyipes
Posted Oct 03, 2012 - 3:48 PM:

Ok, I could use that for $30 ... I stink at .htaccess and tend to break stuff. I'm attaching my current .htaccess file, removing all those special urls cleaned it up quite a bit.

So when it's time, for every instance of {CATREWRITEPATH} in the SEO page, I'll change it to {CATNAME}, and for every instance of {LINKREWRITEPATH} I'll change it to {LINKCATNAME} correct? And all the old paths will get 301 redirected to the new.

You can send a paypal invoice to my email. Hope it's a smooth move smiling face


Attached Files:
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted Oct 05, 2012 - 3:34 PM:

Upgrade to 7.1.1 Beta 2, then enter this in the other .htaccess content box:
RewriteRule ^([-_\+A-Za-z0-9]+)/([-_/\+A-Za-z0-9]+)/vote\-([-_/\+A-Za-z0-9]+)\-([0-9]+)\.html?$ $2/vote-$3-$4.html [L,R=301]
RewriteRule ^([-_\+A-Za-z0-9]+)/([-_/\+A-Za-z0-9]+)/email\-([-_/\+A-Za-z0-9]+)\-([0-9]+)\.html?$ $2/email-$3-$4.html [L,R=301]
RewriteRule ^([-_\+A-Za-z0-9]+)/([-_/\+A-Za-z0-9]+)/([-_/\+A-Za-z0-9]+)\-([0-9]+)\.html?$ $2/$3-$4.html [L,R=301]
RewriteRule ^([-_\+A-Za-z0-9]+)/([-_/\+A-Za-z0-9]+)/?$ $2 [L,R=301]
RewriteRule ^([-_\+A-Za-z0-9]+)/([-_/\+A-Za-z0-9]+)/([0-9]+)\.html?$ $2/$3 [L,R=301]


This redirects categories, listing details, voting and email pages. Worked for the test URLs I tried.
eeyipes
Member

Usergroup: Customer
Joined: Nov 12, 2004

Total Topics: 9
Total Comments: 20
eeyipes
Posted Oct 05, 2012 - 5:48 PM:

Hey Paul, nevermind ... this rule I had in there

RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.html$ /suggest.php?rewritten=1&action=$1&filled=1&custom=yes&TID=$2&catid=$3 [L]

is breaking the rule for the link rewrite path 301

I'll just remove it and do without. Sorry! What's your email for paypal?
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



Sorry, you don't have permission to post posts. Log in, or register if you haven't yet.