On 10/6/08, Mauro Sacchetto <[EMAIL PROTECTED]> wrote:
> Il lunedì 6 ottobre 2008 19:14:02 hai scritto:
>
> > None of the examples in the manual match against the protocol or
> > hostname part of the URL.
> > I previously described that you also can't match the query string in
> > the rewriterule.
> > You also probably need a trailing slash on the 2nd argument.
> > Note that this rule redirects from the index.php page _to_ the "/"
> > page which seems to be the opposite of what you want.
>
> To optimize the page for search motors, I neet to have always
> a (pseudo)-static address in home. But I proceed for trials & errors
> (moreover errors...). So I tried this (still not working):
>
> Options +FollowSymLinks
> RewriteEngine on
> RewriteCond %{HTTP_HOST} ^example.net [NC]
> RewriteRule (.*) http://www.example.net/$1 [L,R=301]
> RewriteCond %{QUERY_STRING} pagina=home
> RewriteRule ^$ http://www.example.net [R=301,L]
>
> I think more other syntactical mistakes...
> Thax a lot
> MS
The second rewrite redirects requests with the querystring
"?pagina=home" to the homepage. To check querystrings with multiple
parameters:
RewriteCond %{QUERY_STRING} ^(.*&)*pagina=home(&)?
RewriteRule (*.) / [P]
You seem to have the very common goal of having the homepage appear
for / even though your internal URL for the homepage includes extra
text.
RewriteRule ^/$ /index.php?pagina=home [P]
(From other posts)
After, I come back to home using the menu, the address is:
http://www.example.net/index.php?pagina=home
I'd like the address to be http://www.example.net/
You also want the any links to the homepage in your application to use
href="/" rather than href="/index.php?pagina=home". The application
creates those links. The code generating the menus includes the link
to:
http://www.example.net/index.php?pagina=home
This cannot be fixed with basic Apache httpd; you should correct your
menus in the application. (mod_proxy_html might help if you get it to
work.)
HTH,
solprovider