What's wrong with this RewriteRule?

Using mod_rewrite to handle various content issues

What's wrong with this RewriteRule?

Postby theging » Sun Apr 06, 2003 1:14 am

I've put this post in the Content Management section as I don't consider myself an absolute beginner anymore as I've got most of my RewriteRules to work. But for some strange reason I have one that just won't work for me.

I'm trying to make http://www.domain.ext/Admin/content_change_status/24/1/ redirect internally to http://www.domain.ext/admin.php?op=cont ... 4&active=1 where '24' is a numeric variable and '1' is a variable of either '0' or '1'. Using the following RewriteRule:

RewriteRule ^Admin/content_change_status/([0-9]+)/([0-9]+)/$ /admin\.php\?op=content_change_status&id=$1&active=$2 [L]

No matter what I seem to do it only wants to either seem to loop or give me a 404.

Interestingly I can Rewrite http://www.domain.ext/Admin/content_delete/24/ to http://www.domain.ext/admin.php?op=content_delete&id=24 using:

RewriteRule ^Admin/content_delete/([0-9]+)/$ /admin\.php\?op=content_delete&id=$1 [L]

It's almost as if it doesn't want me to use two variables. Can anyone help me with this?!
Posts: 2
Joined: Sun Apr 06, 2003 12:53 am

Postby Caterham » Sat Dec 11, 2004 2:58 pm

are there some other rules which could affect the rewriting process?
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm

Postby seomike » Sat Dec 11, 2004 9:46 pm

if there were a problem with the rule syntax you'd get a 500 error not a 404. I don't think it's finding the admin.php file. I would drop the \ in the admin.php part of your rule since they aren't needed there.

RewriteCond %{REQUEST_URI} ^/Admin/content_change_status.*$
RewriteRule ^Admin/content_change_status/([0-9]+)/([0-9]+)/?$ /admin.php?op=content_change_status&id=$1&active=$2 [L]

I've bolded the things I would change or add :wink:
Posts: 331
Joined: Thu May 06, 2004 7:36 pm
Location: Dallas

Return to Content

Who is online

Users browsing this forum: No registered users and 5 guests