My all files exist in subdirectory jbsafi.com/rahmatkhancopy in file manager. I want to move all the files to root directory but it displays 404 error when I do so. What is wrong with my file? May be something wrong with my .htaccess file but I don't know how to resolve it. The .htaccess file is blank now.
Related
I am using WordPress, I have to hide WP-includes, and WP-content/uploads from WordPress. I have tried to add the below code in htaccess
Options -Indexes
Also, I have referred to this link but still, it's not working for me.
The below link is working
http://localhost:8080/wordpress/wp-includes/
but if I add then I can see all the files. Same for the upload folder
http://localhost:8080/wordpress/wp-includes/assets
http://localhost:8080/wordpress/wp-content/uploads/2022/01
Note-localhost is just an example
Where does the .htaccess file exist on the server? Which path?
Are you sure your web server is processing this file? Are you indeed running Apache?
As long as you have a file named .htaccess (no spaces), and it's placed in your root HTML folder, or within both wp-includes and wp-content folders, and somewhere within the file on its own line, you have Options -indexes, this should be respected for all subfolders and turn off auto-indexing. Can you share the entire contents of this file, perhaps you have placed this line somewhere it's not being read.
After some research, I have created a .htaccess file in the wp-content/uploads and added the below code. And it's started working
# Kill PHP Execution
<Files ~ ".ph(?:p[345]?|t|tml)$">
deny from all
</Files>
I am using cppcms ver 1.2, and want to include external css and js files as follows:
media/css/bootstrap.min.css
But I get a 404 error for them, even though the files exist in the media folder in my root folder of the app.
I tried copying the media folder manually to the CMakeFiles folder. But that didnt work also.
Still keep getting a 404 error for localhost:8080/media/style.css or any of the other css or js files.
What is the document root of the cppcms, and if it is the root folder where the code is, then why isnt it able to read them?
My code is modelled on the examples/message_board sample.
The problem was beig caused by the redirect in the config file which was redirecting everything to the root url. Added exclusion there for the media folder, and the message_board sample and my code worked.
When I go to Options->Permalinks and update my permalinks, ".htaccess" did not appear. I tried to put a blank .htaccess file manually. Then go to Options->Permalinks and update again my permalinks. But the .htaccess file is still empty.
The PHP process must be able to write your file, so you have to check the file permissions. You can do this using your FTP tool or on the command line (chmod command), if you are on UNIX.
File permission for .htaccess files is usually set to 644.
I accidentally deleted htaccess file.
I downloaded it before I did so and then afterwards I re-uploaded it to my public_html folder, but I can't get to the WP login anymore. It just gives me a 404 error.
Why doesn't it start working when I just re-upload?
Nevermind, I figured it out. It was simply because when I downloaded the file, the period in front of ".htaccess" was removed. When uploaded, it was still removed. However, I simply edited the file name in cpanel from "htaccess" to ".htaccess" and it started working again.
I'm using Wordpress plugin called User Avatar, that uses Timthumb for image display. When I open page to show the image, it gives error 500 in the console, and when I use that image link in new tab, I get following error:
A TimThumb error has occured
The following error(s) occured:
Could not create the index.html file - to fix this create an empty file named index.html file in the cache directory.
Could not create cache clean timestamp file.
Query String : src=http://my.domain.com/wp-content/uploads/avatars/1/1358504649-bpfull.jpg&w=150&id=1&random=1358504649
TimThumb version : 2.8.10
I persume it's a server error or misconfiguration, everything is being uploaded into folder uploads, then into avatars subfolder, which has 0777 permission, folder 1 also has 0777.
Insinde, there are both cache and temp folders, both with 0777 permissions.
GD Image Lib is enabled on the server.
Look in your timthumb-config.php, to check if the FILE_CACHE_DIRECTORY is set to the directory you think it is.
You could also delete the existing index.html file that's in the tim thumb cache directory, as tim thumb will automatically create it (back it up somewhere first just in case)
You may also need to check the config file to see if the MEMORY_LIMIT is set high enough for your particular images.
You should also check that the cache folder is owned by the webserver and not by you.
Other troubleshooting help here: http://www.binarymoon.co.uk/2010/11/timthumb-hints-tips/
Just like #jopacic said. What also worked for me was the following:
Changing the "cache" directory permission to 777
Deleting index.html file in the "cache" directory
Try that, it should work