Hi guys,

I have worked in .htaccess file in local server, everything was working fine. When I uploaded the .htaccess file on the main server by the name htaccess, so I got the following error

The requested URL /home.fliq was not found on this server.

what will be the problem in the file?

Please help me

Thank you.

Dani AI

Generated

As discovered, the problem was the filename — the leading dot matters and makes the file hidden. was right to point that out and ’s advice to always save it as .htaccess is sound. To answer the "where do I use this code" question: run a directory listing on the server shell (SSH) if you have shell access, or enable "show hidden files" in your control panel or FTP client if you do not.

If you have SSH access, connect and list the document root to confirm the dotfile is present, for example:

ssh youruser@yourserver
ls -la /path/to/public_html

If you do not have SSH: use your host control panel File Manager (cPanel: Settings -> Show Hidden Files (dotfiles)) or turn on the hidden-files option in your FTP/SFTP client (FileZilla: Server -> Force showing hidden files). Some FTP tools refuse to create names that start with a dot; in that case create the file locally with the dot and upload, or rename it on the server after upload.

If the file is present but rules still do not apply, check these common causes: permissions (typical 644), file encoding (save as UTF-8 without BOM), correct location (document root or the directory you want to affect), and server type/config (Apache must allow .htaccess via AllowOverride; Nginx ignores .htaccess). To set permissions from shell:

chmod 644 /path/to/.htaccess

If problems continue, review the webserver error log for messages and contact the host if you cannot change AllowOverride. Apache’s official how-to is a useful reference: Apache .htaccess How-To.

Recommended Answers

All 7 Replies

Is it named .htaccess on the server or is it named htaccess? The leading dot matters.

it is named htaccess not .htaccess.

it must be named .htaccess

Hi I named it to .htaccess, now it is working, thank you, but the problem is that i cannot see the .htaccess file on the server because it is invisible.

what is it now?

use ls -a to see hidden files. In Linux (and derivatives) files preceded with a . are hidden.

where do I use this code??

always save htaccess file as .htaccess

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.