modrewrite RewriteRule problem
Posted
by timpone
on Stack Overflow
See other posts from Stack Overflow
or by timpone
Published on 2010-05-25T21:54:37Z
Indexed on
2010/05/25
22:11 UTC
Read the original article
Hit count: 288
apache
|mod-rewrite
I am using Apache 2.2 and mod_rewrite. I would like to take the following urls and map them to another url. The pattern is simple and like this:
http://domain/test/ex1.html -> http://domain/app/index.php/content/?name=ex1
I tried the following in an .htaccess file:
RewriteEngine On
RewriteBase /app/
RewriteRule (.*)\.html index.php/content/?name=$1
and
RewriteEngine On
RewriteRule (.*)\.html /app/index.php/content/?name=$1
I wasn't sure if the backreference was correct so set to $0 and $2 but never seemed to help.
I also tried setting the RewriteLogLevel to 9.
There is a step where it is almost there: rewrite 'ex1.html' -> 'index.php/content/?name=ex1'
The last line of the rewrite log is as follows: [perdir /var/www/domain/htdocs/test/] internal redirect with /app/index.php/content/ [INTERNAL REDIRECT]
How can I get this to rewrite to /app/index.php/content/?name=ex1 ?
thanks
© Stack Overflow or respective owner