root_directory:
wp-content/
wp-admin/
wp-includes/
stackoverflow
The text above is the sample directories in my root folder.
This time I want to create a page named "stackoverflow".
Everything is working, the page is created and the url is
www.mywebsite.com/stackoverflow
Now, every time I visit www.mywebsite.com/stackoverflow, it only loads the directory and not the page.
Any solutions for this guys? Thanks!
You have to change your directory name or your file name.
You cant keep directory and file with same name in same directory.
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>
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.
I have a local wordpress website on IP "192.168.0.115".
There is a page in it called "Invoice" ("192.168.0.115/invoice").
I have about 800 PDF (invoice) files.
I would like their URL to be "192.168.0.115/invoice/invoice001.pdf", "...002.pdf" and so on.
What I did:
I made a folder called "invoice" in the htdocs folder next to "wp-admin", "wp-content" and "wp-includes" where I put all 800 PDF files.
It worked out - when I entered the URL "192.168.0.115/invoice/invoice001.pdf" it opened the desired PDF file.
But when I entered the url "192.168.0.115/invoice" I had no longer access to the page "Invoice".
Instead I got all of the files listed as in a folder through the browser.
I couldn't access the page, because of the same folder name and same page name -> "invoice".
My question:
Is there any way I can tell wordpress to ignore the folder called "invoice" and load the page with URL "192.168.0.115/invoice" AND in the same time open files with URL "192.168.0.115/invoice/invoice001.pdf"?
If you are using apache you can add a rewrite rule to your .htaccess file.
You can't have a WordPress page and a folder named that same thing. So the first thing you need to do is change your folder name from invoice to my-invoices. Then you add this rule to your .htaccess file:
RewriteRule ^invoice/(.*).pdf$ my-invoices/$1.pdf
Don't forget to rename your folder, but leave your WordPress page slug.
Then you'll be able to go to each of these URLs:
http://192.168.0.115/invoice/
http://192.168.0.115/invoice/invoice001.pdf
Be sure to place your new rewrite rule above the ones for WordPress.
I have a wordress site but I have a simple page which is not part of the wordpress project
http://sitetest.com/mypage.php
How can I make wordpress ignore this file and allow it to be shown
Just upload this php file to your /public_html directory and run as usually http://sitetest.com/mypage.php, it should work.
UPD. I checked and it works for me.
Just put the file in the site root folder. It will be accessible.
Example: if your site root is /var/www/html/ or public_html then put the file in html/public_html folder where others WordPress files & folders are like wp-content, wp-includes, wp-admin etc.
So I have been reading all i can for the last 2 hours and have not a solution.
I moved my drupal site from one host to another, all works well minus:
images in the the 'sites/defualt/files' folder are in the FTP and i can priview them there but when got to the URL I just a page not found message.
example image URL: http://www.example.com/sites/default/files/image.jpg
this what's in my code and the path is correct but the image does not show.
Here's what I have checked:
Clean url's are enabled,
'admin/settings/file-system', set to public
'admin/settings/file-system', File system path: 'sites/default/files' as it should be
.htaccess in files folder is set to
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
# Options None
# Options +FollowSymLinks
and I have tried it with '#' removed
I have tried leaving the settings.php $base_url ="" blank and with my exsample domain
I have the files folder set to cmod '777'
Checked the database files table, path is set to 'sites/default/files/imagename.png', which seems right
image names do not have spaces in them.
I have been flushing the cache for the testing different settings
I have run the cron as well.
I don't know what I am missing the files are there, the paths are even correct when i look at the rendered html, but the images are just not showing and the direct urls say 'page not found'
Any Help would be awesome, I thought i had this problem before and solved it but i have no idea I missed.
Thanks for any help
Hhmm, have you checked that all parent folders have at least the execute flag set so that you can browse into them? I think it is safe to set all folders as: 755
Another way to debug this is trying to download other files contained in other folders, e.g. the README in root or some files in the misc/ and modules/ folders.
Just deleted .htaccess file inside default/files it solved the issue for me..I dont exact lines of code need to be there in .htacces file..