Forum Moderators: phranque

Message Too Old, No Replies

Mod rewrite request for help

Another one

         

rubenski

12:38 am on Jun 1, 2004 (gmt 0)

10+ Year Member



Hi all,

I use the following rewriterule

RewriteRule ^article([0-9]+).([0-9]+)*.* article.php?article_id=$1&&pagenumber=$2 [L]

This translates internally from

www.exampledomain.com/articles/article2.3_some_keywords.html

to

www.exampledomain/articles/article.php?article_id=2&&pagenumber=3

That works great. Now, to get the shortest possible URL I want to remove the word 'article' from the friendly URL above so you'll get:

www.exampledomain.com/articles/2.3_some_keywords.html

I tried this rewriterule:

RewriteRule ^articles/([0-9]+).([0-9]+)*.* articles/article.php?article_id=$1&&pagenumber=$2 [L]

This doesn't work. I get a 404. Do you perhaps know what is wrong with this rewriterule?

jdMorgan

1:15 am on Jun 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



rubenski,

Just a guess, but I assume you moved this code up one directory level from /articles/article/.htaccess to /articles/.htaccess. In that case, you'll need to leave 'articles' out of the substitution URL-path; Otherwise, the subdirectory /articles/articles won't be found, and you'll get a 404.

Also, check your error log and see what happened when you got the 404.

Jim