Question : using apache rewriterule in directory

A very simple example of using rewrite rule is online in several places

In the example both  the script and .htaccess are in the root directory and everything works fine.

However when I try to move to mydomain.com/testarea/nothing works

here is the .htaccess file


RewriteEngine On
RewriteBase /

rewriterule ^article/([^-]+)-([^&]+)\.html$ /articles.php?article_id=$1&article_name=$2 [L]



now I try this


RewriteEngine On
RewriteBase /testarea/

rewriterule ^article/([^-]+)-([^&]+)\.html$ /articles.php?article_id=$1&article_name=$2 [L]



I have tried all sorts of combinations in the rewriterule but nothing works

a solution willbe much appreciated

Answer : using apache rewriterule in directory

Your RewriteRule should look like

RewriteRule ^article/([^-]+)-([^&]+)\.html$ /testarea/articles.php?article_id=$1&article_name=$2 [L]
OR
RewriteRule ^article/([^-]+)-([^&]+)\.html$ articles.php?article_id=$1&article_name=$2 [L]
Random Solutions  
 
programming4us programming4us