Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Apache mod_rewrite question



Hi,

I'm new to mod_rewrite and though I'd ask a question here, if it's not OT.

Here is what I have in my .htaccess right now. But I must be doing something wrong. I tested the following:

RewriteRule ^(.*)\.html $1.php

just to make sure the engine was running and working. It is. the rewrite rule works as it should. But the following, which is what I'm really trying to accomplish, does not work. Can any one give me an idea why it is not? Here's what it all looks like.

-------------------------------------------------
Options +FollowSymlinks
RewriteEngine on

# Set the RewriteBase to "/" for the root level to base everything on... I guess.
RewriteBase /


RewriteRule ^oldpage.php(.+) newpage.php$1&otherid=0 [R]
-------------------------------------------------

The $1 should have all the variable stuff in it from the php.

So I'm looking for it to essentially do this:

oldpage.php?id=1 redirects to newpage.php?id=1&otherid=0

Why is this not working? Any help would be appreciated.

Thanks,

Mark
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Web-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/web-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.