Hi,

I am trying to write some rules for URL rewriting in
Apache. But somehow it is not working completely. Can
anyone please help in this regards:

The original URL where the pages are located is:

http://www.myserver.com/directory1/directory2/?s=ab&id=19

and I want this URL to be written as

http://www.myserver.com/directory1/virtdir/?s=ab&id=19

The following are rules which I have written in the
.htaccess:

RewriteEngine on
RewriteBase /directory1/
RewriteRule ^virtdir$    virtdir/ [L,R]
RewriteRule ^virtdir/$       directory2/?s=ab
RewriteRule ^virtdir/(.*)    directory2/$1


Now when I hit the URL

http://www.myserver.com/directory1/virtdir

I get the contents of 

http://www.myserver.com/directory1/directory2/?s=ab

and on the address bar the URL displayed is

http://www.myserver.com/directory1/virtdir/

In the displayed page, the links are relatively
created as ?s=ab&id=19 ?s=ab&id=21 etc etc

When I point the mouse pointer on any link, on the
status bar I see
http://www.myserver.com/directory1/virtdir/?s=ab&id=19
http://www.myserver.com/directory1/virtdir/?s=ab&id=21
and so on

But when I click on these link the page which I get is
still the old one i.e.
http://www.myserver.com/directory1/virtdir/

but the URL on the address bar changes to the 
http://www.myserver.com/directory1/virtdir/?s=ab&id=19
and so on.

Am I doing anything wrong here? If yes, can someone
please give me the correct rules, which I can place in
my .htaccess and also if you can explain to me what I
was doing wrong.

Regards.
Ajitabh Pandey




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
linux-india-help mailing list
linux-india-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to