Webmastersite.net
Register Log In

mod_rewrite

Title mod_rewrite
Message Text EDIT: sorry I couldn't edit in the version, which is 3.20b2

Hi,
clean install of 320 latest release, no changes anywhere.
Never any problems with 3.13
I wanted to testrun the mod_rewrite.
Script is in /links.
Directory set to http://www.mydomain.com/links in general settings.
Everything works fine, untill I enable mod_rewrite.

category rewrite works fine:
http://www.mydomain.com/links/Catname

however,
links don't work:
http://www.mydomain.com/links/links/1
goes to that exact address and gives
"The requested page does not exist."
instead of the external url.

I've read
http://www.webmastersite.net/oldforums/index.php?showtopic=2515

which seems to be what it's all about,
but I haven't figured what I need to do to fix the problem.

I was just going to post the .htaccess when I saw what the problem is

original:
Options +FollowSymlinks
RewriteEngine on

# If not working, uncomment and correctly fill the line below:
RewriteBase /links

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

RewriteRule ^admin$ admin/index.php
RewriteRule ^admin/$ admin/index.php

RewriteRule ^link/([a-z]+)/([0-9]+)/?$ link.php?action=$1&id=$2
RewriteRule ^link/([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$ link.php?action=detail&id=$2



modified (in bold):
Options +FollowSymlinks
RewriteEngine on

# If not working, uncomment and correctly fill the line below:
RewriteBase /links

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

RewriteRule ^admin$ admin/index.php
RewriteRule ^admin/$ admin/index.php

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

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$ link.php?action=detail&id=$2


this works fine (so far). I suppose you could chuck the "link"-lines. I kept them while trying the "links"-rewrite.
Rating
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5
0/5 based on 0 votes.
Ownership stablehand
Views 671 views. Averaging 0 views per day.
Similar Topics
Submission Date Jul 07, 2005 - 8:17 AM