New Wordpress install causes 403 error on test page access - wordpress

I just installed Wordpress but can't view the "Hello World" test page due to a permissions issue. I'm getting a 403 error. I can get into index.php (in the wp-admin folder) to modify the file, but when I click on the link to view it I get the 403. There is no .htaccess file in my Wordpress folder[see update below]. I'm not sure what permissions to change. I did chmod the permissions on the Wordpress folder to 755 but it had no effect. I did not do any sort of recursion on the chmod as I didn't want to do a blanket permissions change without knowing just what I was doing. What should the permissions be on the various Wordpress files and directories? I'm running a Centos 6 server.
Update:
I have added the following .htaccess file to the wordpress folder but still have the same problem.
#BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /var/www/vhosts/mydomain.com/www/wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /var/www/vhosts/mydomain.com/www/wordpress/index.php [L]
</IfModule>
#END WordPress
BTW, if you wish to vote me down, I understand your need but would appreciate a few words why. Thx.
UPDATE #2:
I have check my permissions and my folders are at 755 and the files at 644, which is what they are supposed to be from the information I'm finding.

I found the answer to this problem. I had to add this line to my .htaccess file. Now everything works:
DirectoryIndex index.html index.php

Related

WordPress Permalinks not found in subfolder

I have WordPress installed in the root folder and in a subfolder. I can access the home page for the WordPress site in the subdomain, but the permalinks does not work – error 404. I have tried to reset the permalinks, but it did not help. I can’t find any .htaccess file, so I have created one myself and placed it in the subfolder directory:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /projects/bigsargefitness/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /projects/bigsargefitness/index.php [L]
</IfModule>
Here is a link to the subfolder WordPress site:
http://ninahortendesigns.com/projects/bigsargefitness/
I have set the database options to the above direction.
Thanks for your help.
You will need to look at a few things:
.htaccess file in the root WP site (WP1) and edit it so that WP1 doesn't catch the URLs and generate 404 errors, I'm not sure if that comment assisted, I've used this answer for a similar issue.
.htaccess file in the sub WP site (WP2) and rename it to "htaccess.old" then log into your wp2/wp-admin, go to "Settings->Permalinks" check the URL structure is as desired (it doesn't usually change) and click "Save" at the bottom of the page. This will regenerate your .htaccess file within the context of the sub-directory and you shouldn't get 404 errors when you visit sub-pages like this
Here's the code from the first link edited so that it should work with your site, although if you have additional rules, you should only insert the line under the comment.
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
# Include in the next line all folders to exclude
RewriteCond %{REQUEST_URI} !(projects) [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
If you have custom rules, only insert these lines
# Include in the next line all folders to exclude
RewriteCond %{REQUEST_URI} !(projects) [NC]
Assuming you're a designer and are uploading examples of sites you've built, you should only have to do step 2 the next time you upload a new site to the wp1/projects/ sub-directory
Cause
Error 404 occurs when the resource or path you requested cannot be reached. In this case it's likely because URL rewrite isn't working properly, hence the permalink requests were still being directed to the requested path (e.g. /projects/bigsargefitness/your-category/your-post-name) instead of the rewritten path (i.e. /projects/bigsargefitness/index.php).
The following solution assumes you use Debian/Ubuntu, otherwise the principles should remain the same.
Solution
Firstly, ensure that the rewrite engine has been installed:
sudo a2enmod rewrite
Then, ensure that the engine is allowed for the subdirectory by editing/adding the following lines in the file /etc/apache2/sites-available/your-site.conf:
<Directory /var/www/projects/bigsargefitness/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
The key here is to ensure that the line says AllowOverride All instead of AllowOverride None.
Finally, restart your server:
sudo service apache2 restart
Let me know if this helps.

Multiple wordpress sites at one host

I have problems with one of my Wordpress sites at my host.
Today I installed "Traffic Stats Widget" - plugin and I followed their instructions for installation. So , I did this:
Create a robots.php file on the root directory of your blog: ie public_html/your-blog/ Paste the following code without // in it:
# #
Open .htaccess file in the same directory and paste this in it:
RewriteRule robots.txt robots.php
Make sure you have the 'RewriteEngine On' clause in place...
Make sure you have a robots.txt file, even an empty one, on the root directory
After that I was unable to access all of my subpages.
This is link of my website:
http://idealpvc-dev.com/websites/camel/
And if you try to access some of subpages you will get error 404.
I don't know why, because I restored my .htaccess file but still it doesn't work.
Also I made comparison with others .htaccess file on other wordpress sites but there isn't any differences except folder names.
Any suggestion will be appreciated.
Also, above is content of my .htaccess:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /websites/camel/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /websites/camel/index.php [L]
</IfModule>
# END WordPress
Sites is located at /public_html/websites/camel
Thanks in advance
Make this as a RewrieBase in your htaccess file
RewriteBase http://idealpvc-dev.com/websites/camel/
Instead of this
RewriteBase /websites/camel/
And make your wordpress permalink Default From Wordpress Admin panel > Settings >> Permalink >>> Default

Unable to access wp-admin

I realized that this question has come up in the past, but I haven't been able to find the solution to my problem.
My wp-admin works fine on my localhost. However, when I migrate to to my live server, I'm no longer able to access it. If I do go to mysite/wp-admin, I get a 404 error.
Some things I've tried:
-Disabling all plugins by renaming the folder
-Deleting plugins one by one
-Changing themes
-Editing permissions to 755 for wp-admin folder
-Adding the below to my wp-config file:
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
Note that when I add these lines I get an error that "this page has a redirect loop".
I used the standard wordpress .htaccess file:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Does anybody have any idea what the issue might be? Any ideas are welcome.
Thanks!
It looks like you've done the standard troubleshooting tests. Try adding the following lines to your active theme's functions.php file.
function flush_my_rules() {
flush_rewrite_rules();
}
add_action('init','flush_my_rules');
Make sure to keep the following lines in your wp-config.php file.
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
Then try visiting your homepage first, then your /wp-admin/ page. See if you continue to get a 404. If you do, try visiting the /wp-login.php page, and see if logging in via there continues to return a 404.

Accessing a subfolder of a Wordpress site

So I have a wordpress website installed in the root of my domain and it is up and running fine. I want to install a shopping cart in a subfolder but it's giving me trouble. I have a folder called "magento". In that folder is a filed called downloader.php and index.php.
When I try to access the file, Wordpress was giving me a 404 error like it was thinking I meant it to look for a WP article.
I tried a different .htaccess file which changed it to a standard 500 error now.
I've googled for this and found tons of people with the same problem, but haven't found a solution that works. I also checked the permissions and the folder is 777 and I changed the files to 777 as well but it still doesn't work.
The .htaccess file in the root (public_html) file simply shows
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wp/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp/index.php [L]
</IfModule>
# END WordPress
I don't know anything about configuring .htaccess files but if anyone has any suggestions on how I can get this to work, that'd be great.
Thanks!!
You can install an empty .htaccess file in the magento subdirectory. This overrides the Wordpress .htaccess file and allows to access the files in that directory.
Never change file permissions to 777. This is dangerous, because it allows anybody to modify your files.

404 error transferring wordpress website from local server

I've transferred my wordpress website from my localserver to a folder on my server. It is located in /wordpress. I have created a new database, new user and password and imported. I have also changed the location and home of the website in wp-options. I have changed the wp-config file. I'm still getting a 404 error. I then tried removing all the files, adding a clean install of wordpress then added my theme but still the same error. I can't even access admin or install. Can someone talk a look and tell me what I've done wrong? I have done this before and it normally works fine. Could it be the hosting?
See website here
I've check my .htaccess file and it says the following:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
# END WordPress
Check you're .htaccess file. I had this exact same issue the other day. Because it's in a subdirectory, it's keeping track of that in the .htaccess file, and I'm going to guess the subdirectory on the server is named differently than what it was on your development environment :)
Check you're .htaccess file and if you dont want to do coding in htaccess file.
Then login to wp-admin and go to the permalink section and hit update button
Hope it will solve the problem
Thanks
First of all remove .htaccess file and login in wordpress to run normally, lets check to conform this error due to .htaccess file.
Hope this helps you. Thanks ;)

Resources