I'm a newbie here. I installed a wordpress in a server run by Apache2. But the wordpress doesn't load index.php page. I can access deshboard and all other categories are displaying well. but the home url is not loading the index.php. Eventhough i try to added /index.php at the end of my url, still it's not working. It just display 404 error. When i look at the theme directory and wordpress directory, there are (index.php) files.
so I googled for solution. some suggested to add
directoryindex index.php in .htaccess file. I did that and that result in 500 internal server error.
Some post in google suggest to look at dir.conf and httpd.conf under Apache2. In my httpd.conf file, I have this line of code
SSLcertificateChainfile /etc/ssl/certs/secure_yosalasd_org.ca-bundle
In my dir.conf file, I have this lines of code
<IfModule mod_dir.c>
DirectoryIndex index.php index.html
</IfModule>
I don't seem to find answer to this problem.I would appreciate if anyone can figure out what is the problem here.
thank you so much in advance
regards
Khun
This may be a long shot, but once saw a simillar problem which in the end the problem was that there was an index.html file as well in the folder.
Make sure such file does not exist.
And did you try re-installing?
may be the premits of htaccess disallow it from working, that will result not found pages
if you uploaded the script though root access
try this command
chown -hR user:user folder_path;chmod -R 644 folder_path/*.php
replace user by your user name, replace folder path by the full path of wordpress
Edit:
The problem is your theme not include index.php
try to explore your theme directory, and check if there is index.php file, or switch to another theme
if the file is exists, Try to change file permissions use the command that i provided above again, i've edited it
You can change main diretory and sub directory all php files permission with this SSH Command
find /top/level/directory -type f -name "*.php" -print | xargs chmod 644
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 have an OpenLiteSpeed VPS WordPress install over at Vultr, and am trying to install a non-WordPress website into a sub-folder I created.
Ex.) https://example.com/test that is pointed to a new folder I created in the WordPress root install directory of /var/www/html/test
I created the directory and placed the files needed there that include an index.php file, however when I go to https://example.com/test, I receive a 404 Not Found error. I believe it has something to do with modifying the .htaccess file in the root of my WordPress install, but am unsure of what to modify 100%.
Any help is appreciated!
I tried modifying the Rewrite rules but am not confident in the options I chose. I since reverted the .htaccess file back to my default settings in which OpenLiteSpeed defines.
This can be closed out - I have it defined in my index.php file that resides in that folder point to a database I created in phpMyAdmin and I had the database field filled out incorrectly. Thank you to everyone who replied though. Oops!
I have installed silverstripe 4 into the /var/www/html folder in apache.
However, when I go to the url, I have to use "localhost/public/index.php" in order to obtain the main page. I thought I was to be able to just go to "localhost" to find the defaut page. What am I to do if I want to have a main page without people having to specify "/public/" before it?
Thanks.
Normally, your localhost website can be resolved without adding /public/ if the following 2 things are configured correctly.
Enable Apache mod_rewrite
Having .htaccess rewrite config in /var/www/html
Troubleshooting
Check if you got the right .htaccess in /var/www/html. Basically, this Apache config file will forward all the requests to /public/ folder.
If .htaccess is fine, make sure your mod_rewrite is enabled in your Apache. Check this link.
I am making my first steps coding and I have wordpress installed on my computer on a local XAMPP server. I try to add an image directly in a page from the wp admin but it's not possible and it shows me this error :
Unable to create directory wp-content/uploads/2016/03. Is its parent directory writable by the server?
Do you know why it happens? I create manually the directory wp-content/uploads/2016/03 and its still happening.
Create folder with name "uploads" in wp-content folder and set this folder permission 777
Hope it will work
Thanks
Try to manually update/change the uploads directory instead of defaults:
Log into your WordPress admin dashboard.
Go to Media Settings menu (Settings -> Media).
Enter wp-content/uploads in the “Store uploads in this folder” text
box.
Save the changes by hitting the “Save Changes” button and you are
done.
Note: if you don't have this option in your wordpress version, you need to edit the wp-config.php file located in the root directory of your WordPress installation.
define( 'UPLOADS', 'wp-content/'.'uploads' );
also you can change the name of uploads folder as you want.
UPDATE 1:
Try adding the following to the top of your .htaccess file (before # BEGIN WordPress line):
<IfModule mod_security.c>
<Files async-upload.php>
SecFilterEngine Off
SecFilterScanPOST Off
</Files>
</IfModule>
I want to create http://localhost/Symfony/temp/.
In temp will be a basic index.html and some images. If I create the folder right now and put the index.html file in /temp/ I get a 404.
How do I get a normal response from http://localhost/Symfony/temp/index.html?
Requests going to temp/ are being caught by Symfony's default .htaccess. You'll have to add following:
# allow access to temp
RewriteRule ^temp.* - [QSA,L]
If you want it to work even with app_dev.php just change it to ^[app_dev.php/]*temp.*.
But I'm more interested why do you want to do that in root directory and not in static files directory (eg. web/static/temp). You wouldn't need to mess around with .htaccess and you'd be able to link to such images with asset(...).
Here's the solution I eventually came up with.
All I did was create a .htaccess file in /temp/ and inserted:
allow from all
Since I was getting a 404 error and all the other symfony folders had a .htaccess with
deny from all
I reversed engineered an answer.
Hope this helps someone else.