htaccess/Permalink issue with Wordpress - php

I'm facing an issue with Permalink for Wordpress site that I have hosted on ubuntu server. Whenever I save the permalink setting I receive an error to modify .htaccess file and update the setting as provided below,
<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>
I did this activity but the links are not working I'm receiving 404 error.
Before updating this file link the url's used to work with index.php/
This .htaccess file is placed in the folder where I have installed the folder.
Any input in this regard will be appreciable.
Thanks in advance.

If this .htaccess file is in the /wordpress directory, then move it to the above directory, and it should work.

Related

Requested URL was not found on this server

We using server centos. Running my site, currently working home page itself, rest of page not working. Please help me
File Path
/var/www/html
Not Found
The requested URL /about-us/ was not found on this server. this error coming out.
.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
You can login in wp-admin backend with credentials Administrator.
You need to be sure that the .htaccess file is editable
So, go in Settings -> Permalink, and refresh this (save without edit anything).
Another test:
I suggest return your permalink to default ( /?p=ID ) so you ensure that .htaccess is the problem.

wordpress 404 error when trying to acess folder on root

I have a wordpress website and within the root directory a folder called /ideal/.
The function for the /ideal/ folder is to make payments trough the website from visitors.
Everything worked well for a while, since a few days there is a problem with the page.
When i navigate to my website http://www.nibincasso.nl/ideal/ it wil show up with a 404 error.
With the release of wordpress 4.0 it looks like wordpress is trying to make some sort of dynamic link for the folder /ideal/.
However i want it to open as a static page, not by making it a wordpress dynamic page. “http://www.nibincasso.nl/ideal/index.php”.
Example of .htaccess:
# 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
Can someone help me with a solution for this problem?
Kind regards,
Fabi
Update *
I created a new subdirectory on my root with a blank index.php page only saying test
This one opens fine. But when i try to enter the subdirectory /ideal/ with the index.php i get a 404 error. How come?
Try following
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /ideal/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /ideal/index.php [L]
</IfModule>
# END WordPress
There seems to be a problem with the php code inside the index from the /ideal/ folder.
I will search for the solution this is not a wordpress problem.
Thanks for helping me for so far.

Error 403 Forbidden if I go to a wordpress url that is the same of an existing directory

I am developing a new site in wordpress, my site is completed and I want to replace it with my old site (not a wordpress site, a php and html site).
The moving wordpress procedure is correct (I have installed wordpress in a subdirectory), i can see everything but when i go to a page like www.site.com/mypage which is the same name of an existing folder in my site (www.site.com/mypage) i get the 403 error.
in the folder there is not a index.php/html file.
I want to keep this permalink structure and the folders name..
I do not want to show the list of files in the directory, but only the page I have created in wordpress.
how can I fix it?
thank you
htaccess here:
# 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
Just ran into this problem and found an answer here: http://jeffreybarke.net/2011/01/wordpress-permalinks-403-forbidden-error/
In short, you need to write a few lines into your .htaccess which specify the folder names with the problem:
# Fix 403 errors on existing directories; WordPress overrides.
RewriteCond %{REQUEST_URI} ^/(folder1|folder2|etc)/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . /index.php [L]

Redirect to outside Wordpress

I have a folder called "stats" on my server that I cannot access anymore because wordpress redirects it to the "Page not found". This folder has nothing to do with wordpress. I have searched for a solution but nothing seems to be working. I am using the theme elegant fusion.
For clarification, the folder is on the same level directory wise as "wp-admin", "wp-content", "wp-includes".
Does anyone know how I can access my folder without going through wordpress?
Thank you in advance!
Enable searach engine optimised permalinks is the answer. I am thinking you must be using the default permalinks, by enabling seo permalinks in Settings->Permalinks in the backend will create (assuming permissions allow, if not you do it manually) an .htaccess file in the root of your install like so;
# 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
The two lines that will solve your problem are;
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
Which tell wordpress to ignore any url which is for an actual directory or file. Anything else gets rewritten by Wordpress.

How to add an exception to a mod_rewrite rule (wordpress site)

I have a WordPress website im trying to call a php script that is located on the website the URL is something like this
http://example.com/folder/process.php
The problem is when I try to do this i always get redirected to the themes "not found" page.
This is the 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
If i put a test.html file in that directory it will work, and show the contents of the .html file. I think it has something to do with the .php extension it doesn't like?
If i call example.com/wp-config.php it finds that file and deosnt show a 404 page..
This Rule says "If request starts with index.php, do not rewrite and stop".
RewriteRule ^index\.php$ - [L]
Immediately before or after that line you could add something like
RewriteRule ^process\.php$ - [L]
To not rewrite requests to that particular file.
Note that you will have to put your file next to Wordpress' index.php for this to work properly.
Change your .htaccess to this:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/+folder/process\.php$ [NC]
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Try turning off mod_rewrite altogether in your /folder/ directory by creating an htaccess file in there and simply adding this single line:
RewriteEngine On
It will make it so any rules from the parent directory won't be applied. If the weirdness with PHP continues, you may want to check if there aren't any rules in your vhost/server config or that things like Multiviews are turned off (via Options -Multiviews).
Ok so if I took a default file that came with the WordPress install made a copy of it in the cpanel rename it remove the code and than put my code in it.
The file is found and it works. So im thinking the only thing left it could have been was a permissions problem. The permissions i put for the file when i uploaded it was 777. I know NOTHING about file permissions.
And i have been working on this for 5 hours and im done trying to figure out what the problem was it works..and im good with that.

Categories