Mod_Rewrite is redirecting.

RewriteRule ^viewPage/([^/]+)/([^/]+)/$ /viewPage.php?ID=$1&Title=$2 [NC,L]

Typing in

www.domain/viewPage/123/abc/

is returning back

www.domain/viewPage.php?ID=123&Title=abc

I don't want the page to redirect from www.domain/viewPage/123/abc/ to www.domain/viewPage.php?ID=123&Title=abc.

link|improve this question
Do you mean you want to hide the viewPage.php and only leave the URL as www.domain/viewPage/123/abc/? – Janne Pikkarainen Nov 22 '11 at 12:32
1  
@user, that's wonderful, but it would really help if you told us what you do want. We don't read minds... – Chris S Nov 22 '11 at 13:57
Are you sure it's mod_rewrite? Turn up rewrite debug logging and verify. – Shane Madden Nov 22 '11 at 16:08
that is correct. I want hide viewPage.php and leave www.domain/viewPage/123/abc/. – user1058903 Nov 23 '11 at 9:04
feedback

1 Answer

Strange:

RewriteEngine On
RewriteRule ^viewPage/([^/]+)/([^/]+)/$ /viewPage.php?ID=$1&Title=$2 [NC,L]

You say you don't want a redirect, and that's what it does actually. With the rule above, the URL is changed internally = only on the server side, there's no redirect, the URL of the client won't change.

So maybe you didn't provide the full rewrite rules, and there's a problem somewhere else, where you do a redirect. Please search for the option [R,L] with an R like Redirect.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.