Mobile app version of vmapp.org
Login or Join
Samaraweera270

: My robots.txt is showing on one line after uploading So I have a weird issue, and I'm not sure if its caused due to my error or what, but when I upload a robots.txt like below: User-Agent:

@Samaraweera270

Posted in: #RobotsTxt

So I have a weird issue, and I'm not sure if its caused due to my error or what, but when I upload a robots.txt like below:

User-Agent: *
Disallow: /dev/
Disallow:/wp-admin/
Disallow:/wp-includes/
Disallow:/wp-login.php


It shows up in Google Webmaster like below, and also if I redownload said file, it will also appear this way

User-Agent: *Disallow: /dev/Disallow:/wp-admin/Disallow:/wp-includes/Disallow:/wp-login.php


How can I correct this? Is this telling me I'm doing something wrong? Is this a whitespace issue?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Samaraweera270

2 Comments

Sorted by latest first Latest Oldest Best

 

@Sarah324

Edit the file again with the editor in your Cpanel. Use Code editor or Simple editor both works.

For this - Select the Robot.txt file and select editor or code editor from the toolbar in file manager (cpanel).

Save changes and test again.

10% popularity Vote Up Vote Down


 

@Nimeshi995

Much of the time, there are two things to look at.

One is, if you are editing the file on Windows, the CR (carriage control) LF (line feed) [EOL] (end of line) marker needs to be changed to just LF for Linux. Some editors and tools allow for this with an option while others do not. Also keep in mind that there are 3rd. party tools that get in the way of the process such as management tools.

The second is how the file is transferred. Most of the time, an FTP client is used and text is not the default transfer method, however, most FTP clients will use text for a .txt file extension at least. I have had to specifically select text over binary even for obvious text files before. Most FTP clients will handle file extensions correctly. Still, sometimes the file is not converted correctly even with the best of intentions. As well, I have seen FTP servers at fault here though rarely.

Whenever you see a problem like this, check to see if the uploaded file matches the original with something like WordPad where the code can be examined. This can tell you if the file is being uploaded correctly. Many control panels will allow you to open a file transparently to properly compare the two. If the upload is not handling the [EOL] marker properly, then it is likely the transfer method. For FTP, you can always force text transfers over binary. If this still does not work, then in any control panel, you can simply upload the file. Some will make the change for you. If that still does not work use SSH (shell) and edit the file, remove the contents, then cut and paste from the original. This should always work. For smaller files, this works a treat. For larger files, it can be frustratingly slow but should work fine as well.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme