.htaccess Long Lines

The .htaccess file is a kind of Apache file and it controls your website behaviour. You choose to edit the existing .htaccess file or to create a new text file, named .htaccess. The codes of this file have long life.

It’s possible to have a line break if you edit the .htaccess file in cPanel's text editor (or other text editors). Some site errors are caused by this line break. But don’t worry. You can easily make correction of the code via the Code Editor built into cPanel or an offline editor.



Use cPanel's Code Editor

1. Use your cPanel's File Manager to create a new file. You can save it anywhere (typically in the domain's document root) and name it how you wish - for example: .htaccess.txt
2. Then Right click to open it and select "Code edit" from the pop-up box;
3. Next, paste the desired code in it;
4. Switch over the word-wrapping mode by clicking the toolbar icon;
5. Now, your code is properly arranged (sometimes, you can still see your long lines preserved as single numbered lines);
6. Click Save;
7. Rename the current file name from .htaccess to .htaccess-old;
8. Refresh the page.
9. The system will automaticlly create a new, blank .htaccess file in your cPanel File Manager.
10. Copy the formatted code from your .htaccess.txt file into the new .htaccess file;
11. Again click Save;
12. Finally, try it. As a result your code should haven’t any break errors now.

Using an offline text editor

1. Choose and open one text editor (like Notepad, Wordpad, ShiftEdit, etc.);
2. Paste your code into a new file;
3. Word Wrap should be off (under Format);
4. Then save the file as “htaccess.txt”;
5. Next, upload the new file to the desired directory.

Finally, follow above "Use cPanel's Code Editor" steps from 7 to 12 in order to replace the broken code with the new one.

Was this answer helpful?

 Print this Article

Also Read

PrestaShop - Installation via Softaculous

PrestaShop installation with all Linux hosting plans can be done very easily - by using...

Magento - Installation via Softaculous

Magento installation with all Linux hosting plans can be done very easily - by using Softaculous....

PHP Configuration Plugin

Sometimes there are problems with PHP Packages that your server handles. In this case it’s...

Common causes of security breaches. Ways to increase safety and prevent from malicious breaches

Security of online applications is essential for their smooth operation and storage of the...

Where to find my FTP account details and DNSs?

Question: I can not find the FTP account details. Where can I find them. Also, I need to know...