Forum Moderators: phranque

Message Too Old, No Replies

apache mod rewrite need help

         

pabludes

6:09 am on Apr 9, 2008 (gmt 0)

10+ Year Member



Hello everyone!

I have website for example mypage.com. I want to do url rewrite to my page. But there are some exceptions.

I want to rewrite only if url is

mypage.com/index.php?part=content&c=contacts

(contacts are dinamic)

So rewrite will be:


RewriteRule ^([^/]*)$ index.php?part=content&c=$1 [L]

(example: mypage.com/contacts)

All other ways I don't want to rewrite url.
Like www.mypage.com/index.php?part=users&login=show and so on..

Also I don't need rewrite if I am in /admin/ directory (administration content goes there).
So what should be RewriteCond?

Please help, thanks!

jdMorgan

2:20 pm on Apr 9, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



We can't answer, because after rewriting, /index.php?part=users&login=show is no longer your URL, it is only a filepath on your server.

We'd need to see the static-looking URLs that correspond to this filepath --and all others-- to answer your question.

To exclude the admin subdirectory URL-path, use


RewriteCond %{REQUEST_URI} !^/admin/

Jim

[edited by: jdMorgan at 2:21 pm (utc) on April 9, 2008]

pabludes

8:00 pm on Apr 9, 2008 (gmt 0)

10+ Year Member



Thanks a lot! Already solved my problem! ;)