I have this website: https://oneclickpy.com/ The homepage is working fine. But no one of the other pages works :(
My config.php: $config[‘base_url’] = “https://oneclickpy.com”; $config[‘index_page’] = ‘’; $config[‘uri_protocol’] = ‘AUTO’;
My routes.php: $route[‘default_controller’] = “home”; $route[‘admin’] = “admin/login”; $route[‘apple’] = “home/apple”; $route[‘xiaomi’] = “home/xiaomi”; $route[‘samsung’] = “home/samsung”;
My .htaccess: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1 !^(index.php|assets|upload|robots.txt|..css) RewriteRule ^(.)$ index.php?/$1 [L]
Rewrite mod is enabled on VPS.
It was working fine in other hosting, but not on DO. When I open the website home, it’s ok. But when trying to open other pages (like “apple”, “samsung”), I got 404 error.
What can I do?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there @rickfontoura,
I believe that you need to enable AllowOverride in order for your .htaccess to take effect.
To do that you need to add the following in your Vhost:
<Directory /var/www/oneclickpy.com/public>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Note that you need to update the /var/www/oneclickpy.com/public part to match your document root.
Then run a config test and restart Apache.
After that the rules that you have in your .htaccess file would take effect.
Hope that this helps! Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.