sEnte Posted February 12, 2013 at 10:28 AM Report #494960 Posted February 12, 2013 at 10:28 AM Hi Tenho andado a tentar meter o RewriteEngine a funcionar mas estou com problemas aqui /etc/apache2/apache2.conf não encontro nada relativo a rewrite. também tentei aqui /etc/php5/apache2/php.ini mas a mesma coisa após uma pesquisa encontrei isto a2enmod rewrite mas diz que o módulo rewrite já está activo de qualquer maneira mesmo depois de reiniciar não me permite usar o RewriteEngine On Já agora esta é a minha syntax RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^(.+)$ index.php?url=$1 [QSA, L] "If It Ain't Broke, Break it and build something Cooler!" Unknown
HappyHippyHippo Posted February 12, 2013 at 10:39 AM Report #494961 Posted February 12, 2013 at 10:39 AM onde colocaste esse código : .htaccess ou no /etc/apache2/sites-available/default ? IRC : sim, é algo que ainda existe >> #p@p Portugol Plus
sEnte Posted February 12, 2013 at 10:41 AM Author Report #494963 Posted February 12, 2013 at 10:41 AM em var/www aquela syntax é de um ficheiro .htaccess que tenho em var/www/projeto "If It Ain't Broke, Break it and build something Cooler!" Unknown
HappyHippyHippo Posted February 12, 2013 at 10:56 AM Report #494966 Posted February 12, 2013 at 10:56 AM se tens o módulo do apache ligado, então deveria funcionar a única razão que vejo para não funcionar é teres o AllowOverride "desligado" na configuração do teu site, não deixando a execução do .htaccess verifica no segundo ficheiro que disse acima (/etc/apache2/sites-available/default) pelo seguinte código: <Directory /var/www/> # ... # deverá ter "none" e altera para "All" AllowOverride All # ... </Directory> IRC : sim, é algo que ainda existe >> #p@p Portugol Plus
sEnte Posted February 12, 2013 at 11:03 AM Author Report #494967 Posted February 12, 2013 at 11:03 AM Depois de usar estes comandos para reiniciar sudo /etc/init.d/apache2 restart sudo service apache2 restart (muito provavelmente este é o único necessario mas pronto) tenho isto como erro Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Já estive a ver e parece que tenho de ir ao httpd.conf para meter o mod_rewrite, mas esse ficheiro no meu nem sequer existe li algures que em vez de httpd.conf é apache2.conf mas mesmo assim lá dentro não encontro essa porra "If It Ain't Broke, Break it and build something Cooler!" Unknown
HappyHippyHippo Posted February 12, 2013 at 11:06 AM Report #494968 Posted February 12, 2013 at 11:06 AM vê o ficheiro /var/log/apache2/error.log e diz quais são as últimas linhas IRC : sim, é algo que ainda existe >> #p@p Portugol Plus
sEnte Posted February 12, 2013 at 11:07 AM Author Report #494969 Posted February 12, 2013 at 11:07 AM (edited) [Tue Feb 12 10:47:48 2013] [error] [client 127.0.0.1] File does not exist: /var/www/mvc/cenas [Tue Feb 12 11:00:48 2013] [notice] caught SIGTERM, shutting down [Tue Feb 12 11:00:49 2013] [notice] Apache/2.2.22 (Ubuntu) PHP/5.4.6-1ubuntu1.1 configured -- resuming normal operations [Tue Feb 12 11:00:53 2013] [notice] caught SIGTERM, shutting down [Tue Feb 12 11:00:54 2013] [notice] Apache/2.2.22 (Ubuntu) PHP/5.4.6-1ubuntu1.1 configured -- resuming normal operations [Tue Feb 12 11:00:57 2013] [alert] [client 127.0.0.1] /var/www/mvc/.htaccess: RewriteRule: bad flag delimiters [Tue Feb 12 11:05:45 2013] [alert] [client 127.0.0.1] /var/www/mvc/.htaccess: RewriteRule: bad flag delimiters [Tue Feb 12 11:06:12 2013] [alert] [client 127.0.0.1] /var/www/mvc/.htaccess: RewriteRule: bad flag delimiters instalei apache e php usando este tutorial https://www.digitalocean.com/community/articles/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu e nesta parte do tutorial apt-cache search php5- instalei isto sudo apt-get install php5 php5-curl php5-gd php5-ffmpeg php5-cgi php5-fpm php5-dev php5-geoip php5-xdebug php5-dbg muito provavelemente instalei coisas a mais mas ok EDIT: Se usar um link assim http://localhost/mvc/index.php/anything funciona, aparece 1 que é o que meti dentro do index.php mas se meter assim http://localhost/mvc/anything já não funciona EDIT1: HappyHippyHippo obrigado mas já está resolvido O meu problema é que no AllowOverride eu estava mudar um de cada vez, mas sempre que mudava metia o anterior para None. Alterando os dois primeiros resolvi o assunto. Obrigado Edited February 12, 2013 at 12:27 PM by sEnte "If It Ain't Broke, Break it and build something Cooler!" Unknown
HappyHippyHippo Posted February 12, 2013 at 12:42 PM Report #494982 Posted February 12, 2013 at 12:42 PM [QSA, L] tira o espaço IRC : sim, é algo que ainda existe >> #p@p Portugol Plus
sEnte Posted February 12, 2013 at 01:25 PM Author Report #494989 Posted February 12, 2013 at 01:25 PM Já tinha mudado isso Obrigado "If It Ain't Broke, Break it and build something Cooler!" Unknown
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now