Webmastersite.net
Register Log In

Mod Rewrite fails on special characters
fails on . and +

Comments on Mod Rewrite fails on special characters

mc19
Forum Regular

Usergroup: Customer
Joined: May 14, 2006

Total Topics: 41
Total Comments: 103
mc19
Posted Dec 14, 2008 - 5:21 am:
I have two categories like the followings.

C and C++
ASP.Net

Their URLs and subcategories' URLs are ..../XXX , which XXX are digits.

Other categories are all like ..../category-name

What can I do to make these two categories along with their subcategoris appear like the usual format, .../category-name ?

Thanks!

Edited by mc19 on Dec 14, 2008 - 5:23 am
Paul
developer

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

Total Topics: 61
Total Comments: 7862
Paul
Posted Dec 15, 2008 - 5:10 pm:
If you have characters in the names that aren't appropriate for that portion of a URL, you'll have to include {CATID} in your category rewrite scheme. For example, {CATREWRITEPATH}-{CATID}/{PAGE}.html
mc19
Forum Regular

Usergroup: Customer
Joined: May 14, 2006

Total Topics: 41
Total Comments: 103
mc19
Posted Dec 16, 2008 - 4:57 am:
Thanks for the help.

Most URLs of subcategories are very SE-friendly now.

But two categories I mentioned on the first post, are still not like /category-name-x .

C and C++ -> .../c-and-c2b2b-5
- I belive the scirpt rewrite ++ to 2b2b.

ASP.Net -> .../4-4
- the script still can't handle/rewrite the dot (.) , and all subcategories' URLs are appeared like the main category /X-X.

Is there a way we can improve the rewrite for above problem?

Paul
developer

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

Total Topics: 61
Total Comments: 7862
Paul
Posted Dec 17, 2008 - 11:59 am:
Fixed for next release.
mc19
Forum Regular

Usergroup: Customer
Joined: May 14, 2006

Total Topics: 41
Total Comments: 103
mc19
Posted Dec 18, 2008 - 5:42 am:
That will be great!
mc19
Forum Regular

Usergroup: Customer
Joined: May 14, 2006

Total Topics: 41
Total Comments: 103
mc19
Posted Dec 26, 2008 - 6:16 am:
Well, I have upgraded to the 5.0.27.

for special characters such as + and ., they are handled very well now.

I have this setting on 'Search Engine Optimization Settings'.

{CATREWRITEPATH}-{CATID}/{PAGE} .html

Categories are supposed to be like ...../category-name-X, however it works on single word only. If we have combination words such as 'Development Tools', script will rewrite the URL like ...../142-142 where 142 is the categories' ID.

It seems that the new release fixed the special characters issue but generating new bugs on mod-write.

this is part of my htaccess.

RewriteRule ^members/([0-9]+)\.html?$ memberlist.php?rewritten=1&page=$1
RewriteRule ^members/([-_/\+A-Za-z0-9]+)-([0-9]+)-trader\.html?$ trader.php?rewritten=1&id=$2
RewriteRule ^members/([-_/\+A-Za-z0-9]+)-([0-9]+)\.html?$ memberlist.php?rewritten=1&action=profile&id=$2
RewriteRule ^members/?$ memberlist.php?rewritten=1
RewriteRule ^help/?$ help.php?rewritten=1
RewriteRule ^help/([-_/\+A-Za-z0-9]+)/?$ help.php?rewritten=1&action=showcat&name=$1
RewriteRule ^help/([-_/\+A-Za-z0-9]+)/([-_/\+A-Za-z0-9]+)-([0-9]+)\.html?$ help.php?rewritten=1&action=showitem&id=$3


RewriteRule ^([a-zA-Z0-9]+)-tags/?$ search.php?rewritten=1&filled=1&action=filter&whichtype=links&tagscondition=like&tagssearch=|$1|

RewriteRule ^([-_/\+A-Za-z0-9]+)/vote-([-_/\+A-Za-z0-9]+)-([0-9]+)\.html?$ vote.php?rewritten=1&id=$3&categorypath=$1&linktitle=$2
RewriteRule ^([-_/\+A-Za-z0-9]+)/email-([-_/\+A-Za-z0-9]+)-([0-9]+)\.html?$ email.php?rewritten=1&id=$3&categorypath=$1&linktitle=$2
RewriteRule ^([-_/\+A-Za-z0-9]+)-([0-9]+)\.html?$ comments.php?rewritten=1&id=$2&linktitle=$1

RewriteRule ^([-_/\+A-Za-z0-9]+)-([0-9]+)-([0-9]+)\.html?$ comments.php?rewritten=1&id=$2&page=$3
RewriteRule ^([-_/\+A-Za-z0-9]+)-([0-9]+)\.html?$ comments.php?rewritten=1&id=$2
RewriteRule ^([0-9]+)/?$ index.php?rewritten=1&action=displaycat&catid=$1
RewriteRule ^([0-9]+)/([0-9]+)/?$ index.php?rewritten=1&action=displaycat&catid=$1&page=$2
RewriteRule ^([0-9]+)/sp([0-9]+).htm$ index.php?rewritten=1&action=displaycat&catname=$1&subpage=$2
RewriteRule ^[-_/\+A-Za-z0-9]+-([0-9]+)/?$ index.php?rewritten=1&action=displaycat&catname=$1
RewriteRule ^[-_/\+A-Za-z0-9]+-([0-9]+)/([0-9]+)\.html?$ index.php?rewritten=1&action=displaycat&catname=$1&page=$2



Edited by mc19 on Dec 26, 2008 - 6:20 am
Paul
developer

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

Total Topics: 61
Total Comments: 7862
Paul
Posted Dec 27, 2008 - 10:20 pm:
Confirmed the problem, will be fixed shortly.
mc19
Forum Regular

Usergroup: Customer
Joined: May 14, 2006

Total Topics: 41
Total Comments: 103
mc19
Posted Jan 03, 2009 - 9:43 pm:
Sorry to bother, but i found one more bug even though the above problems are solved in the latest version.

I have this setting on 'Search Engine Optimization Settings'.

{CATREWRITEPATH}-{CATID}/{PAGE} .html

Let say there is a main category.

...../i-am-category-3

and its subcategory URL is supposed to be ..../i-am-category-3/this-is-subcategory-201

In 5.0.28, its showing ..../i-am-category/this-is-subcategory-201, the script eliminates the {CATID} of its upper category.
Paul
developer

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

Total Topics: 61
Total Comments: 7862
Paul
Posted Jan 06, 2009 - 5:02 pm:
That's working the way I intended it. Why include more uninformative numbers than necessary?

If you really want it I guess I could include an alternate {CATREWRITEPATHID} which would include the ids.

Edited by Paul on Jan 06, 2009 - 5:05 pm
mc19
Forum Regular

Usergroup: Customer
Joined: May 14, 2006

Total Topics: 41
Total Comments: 103
mc19
#10 - Quote - Permalink
Posted Jan 09, 2009 - 3:02 am:
Yes, I do want the subcategory URLs to be the extended URLs of their main categories. Its good for SE to pass pagerank to subpages.

Actually, what I mostly prefer is to removed the {CATID} from URL no matter category comes with special characters or not.

Thanks!

Edited by mc19 on Jan 09, 2009 - 3:05 am
Paul
developer

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

Total Topics: 61
Total Comments: 7862
Paul
#11 - Quote - Permalink
Posted Jan 11, 2009 - 11:41 pm:
How can a URL without an id ever identify a category when it's missing characters? I don't believe that's possible.
mc19
Forum Regular

Usergroup: Customer
Joined: May 14, 2006

Total Topics: 41
Total Comments: 103
mc19
#12 - Quote - Permalink
Posted Jan 14, 2009 - 5:59 am:
I don't know how to do.

Can we have the new release with the organized URL structure?

something like this, this is definitely good for SE.
..../i-am-category-x
..../i-am-category-x/this-is-subc ategory-x
..../i-am-category-x/this-is-subcategory-x/anothe r-subcategory-x
Paul
developer

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

Total Topics: 61
Total Comments: 7862
Paul
#13 - Quote - Permalink
Posted Jan 28, 2009 - 2:43 pm:
A {CATREWRITEPATHIDS} to do that can be made available for the 5.1 series (or sooner as a custom project).
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.