Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

530
Visualizações
.htaccess not working in digital ocean server

When I use the .htaccess as followed, I am getting The requested URL was not found on this server error. My configurations are as

Digitalocean: var/www/html/my_site/.htaccess as

<IfModule mod_rewrite.c>
  # Rules to serve URLs which point to files directly
  # ----------
  RewriteEngine On
  RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

I changed /etc/apache2/apache2.conf from

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

To

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

The file /etc/apache2/mods-enabled/dir.conf as

<IfModule mod_dir.c>
   DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
</IfModule>

I changed myapp\application\config\config.php as $config['index_page'] = ''; and $config['uri_protocol'] = 'REQUEST_URI';

And I have run the following commands in my digitalocean server

sudo a2enmod rewrite
sudo service apache2 reload

When I opening my_site in browser, after done all this I am getting the following message Not Found

If I remove the .htaccess and reset myapp\application\config\config.php as $config['index_page'] = 'index.php'; It is working. So pls help.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

It should be like this

<Directory /var/www/html/my_site/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda