a casa ho due siti nella root di apache (/srv/http).
per far funzionare il mode-rewrite su uno dei due avevo creato un vhost:
però così facendo il sito era interrogabile direttamente da localhost e nn da loclahost/book come prima.codice:cat /etc/httpd/conf/extra/httpd-vhosts.conf <VirtualHost *:80> ServerAdmin your@domainname1.dom DocumentRoot "/srv/http/book" ServerName book ServerAlias localhost/book <Directory /srv/http/book> DirectoryIndex index.htm index.html index.php AddHandler cgi-script .cgi .pl Options ExecCGI Indexes FollowSymLinks MultiViews +Includes AllowOverride All Order allow,deny allow from all </Directory> </VirtualHost>
e questo mi impediva di avere la pagina principale per accedere al sito che volevo.
ho creato allora un altro vhost per l'altro sito:
adesso se vado su localhost posso scegliere su quale sito andare, ma il mod_rewrite nn funziona più..codice:NameVirtualHost ip_di_casa # # VirtualHost example: # Almost any Apache directive may go into a VirtualHost container. # The first VirtualHost section is used for all requests that do not # match a ServerName or ServerAlias in any <VirtualHost> block. # <VirtualHost ip_di_casa> ServerAdmin your@domainname1.dom DocumentRoot "/srv/http/book" ServerName book ServerAlias ip_di_casa/book <Directory /srv/http/book> DirectoryIndex index.htm index.html index.php AddHandler cgi-script .cgi .pl Options ExecCGI Indexes FollowSymLinks MultiViews +Includes AllowOverride All Order allow,deny allow from all </Directory> </VirtualHost> <VirtualHost ip_di_casa> ServerAdmin your@domainname1.dom DocumentRoot "/srv/http/lasta" ServerName lasta ServerAlias ip_di_casa/lasta <Directory /srv/http/book> DirectoryIndex index.htm index.html index.php AddHandler cgi-script .cgi .pl Options ExecCGI Indexes FollowSymLinks MultiViews +Includes AllowOverride All Order allow,deny allow from all </Directory> </VirtualHost>
questa è la regola che ho messo:
ribadisco che con un solo vhost funzionava.codice:RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ([^/]+).php index.php?action=$1 [L]
dove sbaglio?

Rispondi quotando