Forum Moderators: phranque
Here is the script:
RewriteEngine On
RewriteBase /articledashboard
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R,L]
RewriteRule ^profile\/([^\/]+)/([0-9]+) publicprofile.php?name=$1&id=$2
RewriteRule ^Category/[^\/]+/([0-9]+)/?(.*) index.php?catid=$1&mode=category
RewriteRule ^Article/[^\/]+/([0-9]+)/?(.*) article.php?id=$1&act=$2
RewriteRule ^rss/[^\/]+/([0-9]+) rssarticle.php?id=$1
RewriteRule ^myarticles/(.*)$ index.php?mode=myarticles
RewriteRule ^(.*)topauthorslist/ topauthors.php?orderby=$1&ordertype=$2&namelike=$3&page=$4
RewriteRule ^(.*)popularlist/ populararticles.php?page=$2
RewriteRule ^(.*)searchresult/ indexser.php?page=$2
The problem is that when you click on
http://example.com/articles/index.php and then for example "Wine and Spirits"
The link tries to go to
http://example.com/articledashboard/Category/Wine-and-Spirits/53
yet all one gets is a 404 error page. As other links work, I assume this is a problem with the category rewrite rule.
Any help would be much appreciated. Is it to do with the rewrite rule, or the Apache httpd.conf setup?
[edited by: jdMorgan at 10:45 pm (utc) on Nov. 13, 2005]
[edit reason] No URLs, please. See TOS, [/edit]
There are several things possibly wrong with this, but let's take first things first.
What specific URL-path are you requesting, what do you expect it to be rewritten to, and and what is it actully rewritten to?
Please use example.com if you need to show a domain name, since we don not allow posting of members personal domains on this site.
Jim
I think I'm talking about (first) this rule not working with my current set up.
RewriteRule ^Category/[^\/]+/([0-9]+)/?(.*) index.php?catid=$1&mode=category
The link on the page points to (or is rewritten to - I don't know)
http://example.com/articledashboard/Category/Food-and-Drink/61
The browser then gives the 404 error.
The same intended page can be arrived at by
http://example.com/articledashboard/index.php?catid=61
with no error.
Hope this explains the problem further. How do I make the rewritten URL go to the correct page? Anymore questions, please let me know.
Regards
RewriteRule ^Category/[^/]+/([0-9]+) index.php?cati[b]d=$2&m[/b]ode=category [L]
I also added an [L] flag and removed unnecessary regex to improve efficiency.
Jim