Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

528
Views
.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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!