Webmastersite.net
Register Log In

htaccess encoding problem
part of mod rewrite is in wrong char. encoding

Comments on htaccess encoding problem

gemini
Forum Regular

Usergroup: Customer
Joined: Oct 30, 2003

Total Topics: 54
Total Comments: 197
gemini
Posted Mar 07, 2007 - 11:19 PM:

I noticed I'm getting double slashes when going to link details page:

wsnlinks//Home-Listings-Arizona-2008.html

I checked .htaccess and here is what I found:


RewriteRule ^members/([0-9]+)/?$ memberlist.php?page=$1
RewriteRule ^members/([-_/\+A-Za-z0-9äüößèà ]+)/trader/?$ trader.php?name=$1
RewriteRule ^members/([-_/\+A-Za-z0-9äüößèà ]+)/?$ memberlist.php?action=profile&name=$1
RewriteRule ^members/?$ memberlist.php
RewriteRule ^help/?$ help.php
RewriteRule ^help/([0-9]+)/?$ help.php?action=showcat&id=$1
RewriteRule ^help/([0-9]+)/([0-9]+)/?$ help.php?action=showitem&id=$2

RewriteRule ^links/([a-z]+)/([0-9]+)/?$ link.php?action=$1&id=$2
RewriteRule ^links/([0-9]+)/?$ link.php?id=$1

RewriteRule ^thread/([0-9]+)/?$ comments.php?id=$1
RewriteRule ^thread/([0-9]+)/([0-9]+)/?$ comments.php?id=$1&page=$2

RewriteRule ^([0-9]+)/?$ index.php?action=displaycat&catid=$1
RewriteRule ^([0-9]+)/([0-9]+)/?$ index.php?action=displaycat&catid=$1&page=$2

RewriteRule ^([-_/\+A-Za-z0-9äüößèà ]+)/?$ index.php?action=displaycat&catname=$1

RewriteRule ^/([-_/\+A-Za-z0-9äüößèà ]+)-([0-9]+).html$ comments.php?id=$2
RewriteRule ^/([-_/\+A-Za-z0-9äüößèà ]+)-([0-9]+).html$ link.php?action=detail&id=$2


gemini
Forum Regular

Usergroup: Customer
Joined: Oct 30, 2003

Total Topics: 54
Total Comments: 197
gemini
Posted Mar 08, 2007 - 12:32 AM:

I was looking at it again.. and may be it supposed to be like that, I just see something like this first time.

If the htaccess file is correct, how I can keep full path with category names in it for the links details page? Right now it looks like this wsnlinks//Home-Listings-Arizona-2008.html
Paul
developer

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

Total Topics: 61
Total Comments: 7868
Paul
Posted Mar 09, 2007 - 4:59 AM:

Double slashes usually indicate you have your directory url set with a trailing slash in the system settings.

how I can keep full path with category names in it for the links details page?

There's never been an option for that as far I can recall.
gemini
Forum Regular

Usergroup: Customer
Joined: Oct 30, 2003

Total Topics: 54
Total Comments: 197
gemini
Posted Mar 14, 2007 - 9:07 PM:

Paul wrote:
Double slashes usually indicate you have your directory url set with a trailing slash in the system settings.


1. I ran some tests and since www.domain.com/wsnlinks redirects to www.domain.com/wsnlinks/ these lines are conflicting and producing double slashes after wsnlinks:


...
RewriteRule ^(.+[^/])$ $1/ [R]
...
RewriteRule ^/{LINKTITLE}-{LINKID}.html/([-_/\+A-Za-z0-9äüößèà]+)-([0-9]+).html$ link.php?action=detail&id=$2
RewriteRule ^/([-_/\+A-Za-z0-9äüößèà]+)-([0-9]+).html$ link.php?action=detail&id=$2


I removed the starting slashes and everything worked out fine. So, this is how it works for me:

...
RewriteRule ^{LINKTITLE}-{LINKID}.html/([-_/\+A-Za-z0-9äüößèà]+)-([0-9]+).html$ link.php?action=detail&id=$2
RewriteRule ^([-_/\+A-Za-z0-9äüößèà]+)-([0-9]+).html$ link.php?action=detail&id=$2


2. Also, when "Combine detail and comments pages" switch is on, detail link redirects to comments.php?id=x type of link. So, I duplicated the detail page rewrite rules and matched them to comments - it works. Of course if I switch back to not to combine details and comments - then details links being redirected to comments. So, I think there should be a condition on SEO Settings page that would check if comments are combined with link details or not and based on that write rules into htaccess since you don't have to have both in there.
gemini
Forum Regular

Usergroup: Customer
Joined: Oct 30, 2003

Total Topics: 54
Total Comments: 197
gemini
Posted Mar 14, 2007 - 9:26 PM:

3. Looks like there is a rule missing for categorty pagination when there are more categories than allowed to show on a single page. The first page is fine, but the rest look like this:

/wsnlinks/index.php?action=displaycat&catid=1&subpage=2&subperpage=40
Paul
developer

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

Total Topics: 61
Total Comments: 7868
Paul
Posted Mar 15, 2007 - 6:23 PM:

I don't see any problem. See http://links.webmastersite.net -- I can't find any double slashes, and the .htaccess is
Options +FollowSymlinks
RewriteEngine on

RewriteBase /

RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [R]



RewriteRule ^admin/?$ admin/index.php

RewriteRule ^members/([0-9]+)/?$ memberlist.php?page=$1
RewriteRule ^members/([-_/\+A-Za-z0-9äüößèà]+)/trader/?$ trader.php?name=$1
RewriteRule ^members/([-_/\+A-Za-z0-9äüößèà]+)/?$ memberlist.php?action=profile&name=$1
RewriteRule ^members/?$ memberlist.php
RewriteRule ^help/?$ help.php
RewriteRule ^help/([0-9]+)/?$ help.php?action=showcat&id=$1
RewriteRule ^help/([0-9]+)/([0-9]+)/?$ help.php?action=showitem&id=$2

RewriteRule ^links/([a-z]+)/([0-9]+)/?$ link.php?action=$1&id=$2
RewriteRule ^links/([0-9]+)/?$ link.php?id=$1

RewriteRule ^thread/([0-9]+)/?$ comments.php?id=$1
RewriteRule ^thread/([0-9]+)/([0-9]+)/?$ comments.php?id=$1&page=$2

RewriteRule ^([0-9]+)/?$ index.php?action=displaycat&catid=$1
RewriteRule ^([0-9]+)/([0-9]+)/?$ index.php?action=displaycat&catid=$1&page=$2

RewriteRule ^([-_/\+A-Za-z0-9äüößèà]+)/?$ index.php?action=displaycat&catname=$1

RewriteRule ^links/([-_/\+A-Za-z0-9äüößèà]+)-([0-9]+).html$ comments.php?id=$2
RewriteRule ^/([-_/\+A-Za-z0-9äüößèà]+)-([0-9]+).html$ link.php?action=detail&id=$2


2. Also, when "Combine detail and comments pages" switch is on, detail link redirects to comments.php?id=x type of link.

No, when you have rewriting on the link details url is rewritten as normal and directly shows the comments. See the links.webmastersite.net already linked above, I have them combined. Perhaps you changed the switch after setting rewriting, so that it hasn't had a chance to write a new htaccess. Submit the SEO page.

3. Yes, category pagination isn't handled by rewriting. I wasn't aware of anyone using it.
gemini
Forum Regular

Usergroup: Customer
Joined: Oct 30, 2003

Total Topics: 54
Total Comments: 197
gemini
Posted Mar 16, 2007 - 12:15 AM:


2. Also, when "Combine detail and comments pages" switch is on, detail link redirects to comments.php?id=x type of link.

No, when you have rewriting on the link details url is rewritten as normal and directly shows the comments. See the links.webmastersite.net already linked above, I have them combined. Perhaps you changed the switch after setting rewriting, so that it hasn't had a chance to write a new htaccess. Submit the SEO page.


Ok, I see now. But here is the problem. Your rewrite rule for the comments is this:
RewriteRule ^links/([-_/\+A-Za-z0-9äüößèà]+)-([0-9]+).html$ comments.php?id=$2 


In my SEO settings format for link details I believe by default was this:
/links/{LINKTITLE}-{LINKID}.html

I changed it to:
/{LINKTITLE}-{LINKID}.html

it created double slashes after wsnlinks folder.
I removed the beginning slash:
{LINKTITLE}-{LINKID}.html

now it gives me 404.

Here is what I get in the .htaccess:
RewriteRule ^{LINKTITLE}-{LINKID}.html/([-_/\+A-Za-z0-9äüößèà]+)-([0-9]+).html$ comments.php?id=$2


Comparing it to your rewrite rule I removed the ^{LINKTITLE}-{LINKID}.html/ part and got this:
RewriteRule ^([-_/\+A-Za-z0-9äüößèà]+)-([0-9]+).html$ comments.php?id=$2

Now everything is working fine. I don't have double slashes nor 404 error page.

As for item #3 in previous post - I just stumbled on it since I had more than 40 categories, which is set by default in the fresh installation, otherwise I don't break them into separate pages.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.