Re: Address rewriting with mod_rewrite

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 6, 2008 at 3:31 PM, Mauro Sacchetto
<mauro.sacchetto@xxxxxxxx> wrote:
> I must translate the following address:
> http://www.giovannifornero.net/index.php?pagina=home
> in the more confortable way:
> http://www.giovannifornero.net
> I tried to put in .htaccess the string:
> RewriteRule ^/index.php?pagina=home$ ^giovannifornero.net  [R=301,NC,L]
> but it doesn't happen anything.
> Is there anything conceptually wrong?
> Are there some mistakes in syntax?

In what direction do you want the rewrite to happen?
Let me guess: You want the user to be able to enter the following in
the address bar in his browser:
http://www.giovannifornero.net
and the webserver should then answer with the same content as if the
user had entered:
http://www.giovannifornero.net/index.php?pagina=home

Am I correct?

In this case you just have you rewrite the wrong way around. You are
trying to rewrite A -> B whereas you need to rewrite B -> A

Doing this in .htaccess files is possible with a rewrite, but this
might not be the best way. If you want visitors to your site to start
at /index.php?pagina=home than the following might work better:

DirectoryIndex /index.php?pagina=home

Krist

-- 
krist.vanbesien@xxxxxxxxx
krist@xxxxxxxxxxxxx
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux