wordpress 500 - Internal server error - wordpress

I installed the wordpress 2.9.2 a few days ago and it works correctly. today , i want to use permlink feature of wordpress.
I know , must modify my .htaccess file on my site root. but on my sub-domain root there is no any .htaccess file . so i create my .htacess file with follow content on sub-domain root (near index.php file):
<files .htaccess>
order allow,deny
deny from all
</files>
ServerSignature Off
<files wp-config.php>
order allow,deny
deny from all
</files>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Options All -Indexes
AddType x-mapp-php5 .php
AddHandler x-mapp-php5 .php
But after save it , i missed my blog . And i get follow error :
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
after this i remove the .htaccess file , but this was not correct.
What i can do for it?
Cheers

I'm not sure what your other settings are there, but your rewrite block is correct. Try removing the rest of the contents of the file all together and see what happens. It may just be that you have more than you even need. Here is the entirety of my .htaccess for one of my WordPress installs with permalinks working correctly.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
- EDIT -
Also, that .htaccess is from a root domain that has sub-domains working accordingly without additional files or modification to the .htaccess.

Seems like a .htaccess file does not exist by default. But when you explicitly change the permalink structure by going to Settings->Permalinks in the WP admin area, a .htaccess file is automatically deleted. So, you may try to delete your current .htaccess file and then enable permalikns from admin area and .htaccess file will be automatically generated. First, my Wp install had no .htaccess file but when I altered the Permalink structure, here's what I got in my .htaccess file:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

I changed the .htaccess file with follow Content:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
But nothing happens and we have error again.
The amazing thing is: I removed the file, but the error is still there.

Related

.htaccess url rewrite does not work on GoDaddy Shared Server, Apache 2.4.3 - 404 error returned

I've created an .htaccess file. A test on madewithlove's htaccess tester (https://htaccess.mwl.be) said the URL rewrite is correct, but a live test returns a 404 error.
URL I want to rewrite:
http://example.com/folder1/folder2/word123 // To redirect to
https://example2.com/en/?key=word123
My .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
# BEGIN Part that is not working
Options -Multiviews
RewriteEngine On
RewriteBase /
RewriteRule ^folder1/folder2/(.*)$ https://example2.com/en/?key=$1 [R=301,L,NE]
# End part that is not working
I am using GoDaddy shared hosting with Apache 2.4.3-25. The WordPress lines work. If they are removed, then Wordpress Page and Blog links break.
I recognize this question resembeles URL Rewrite keeps returning 404 Error, but martoio redirected from an existing file.
I tried both Siraj Khan and Gautam Jha's solutions offered on Friendly URLS / URL Rewriting using .htaccess on godaddy shared server to no avail.
I'm at a loss for what to do, so your help is greatly appreciated.
This is the revised version after including neokio's suggestion:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php
</IfModule>
# END WordPress
# BEGIN Part that is not working
Options -Multiviews
RewriteEngine On
RewriteBase /
RewriteRule ^folder1/folder2/(.*)$ https://example2.com/en/?key=$1 [R=301,L,NE]
# End part that is not working
My .htaccess file, which was located in the public_html folder, base url, was being overridden by another .htaccess file located in folder1.
Check if an .htaccess file is located in a subfolder, because the .htaccess file in the deepest subfolder takes priority.

wordpress The requested URL was not found

When i set plain permalink to post name permalink then page url is not found.
How can i solve this ?
Have you checked your .htaccess file , if you are using permalink rather than default then their should be a .htaccess file with the following code.
# 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
Wordpress will add this by default but may be in some case that may be a permission issue or some server configuration , you have to add by manually.
You can read more about wordpress .htaccess file Click Here

Adding new lines to .htaccess breaks the whole site

I have an issue that when I add a simple line to the .htaccess file it immediately gives me an internal server error. I have no idead what is wrong, the current content of the .htaccess file is the following:
# 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 add a line and get the .htaccess file looking like below, it immediately breaks the site and gives me 500 Internal server error:
# 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
#Begin security
<files wp-config.php>
order allow,deny
deny from all
</files>
Could you kindly let me know what I can check in order to stop this from happening?
Another thing which I also noticed is that if I add a security plugin through wordpress, and start enabling things, it also breaks the site.
I have also looked in the error log when trying to load the site and the following is the error I get:
.htaccess: order not allowed here
I have fixed the issue, what I noticed is that the following configuration in my directory was blocking the .htaccess to work
AllowOverride FileInfo Options
Changed it to the following and everything
AllowOverride All

access folder on root with wp installed

I have wordpress installed on the root . Now what i want that i will create one folder with the name of test and putt some files there and try to access it but i cant access the folder due to the htacess file i guess .
My htacess file is like this
RewriteEngine Off
SetEnv DEFAULT_PHP_VERSION 53
DirectoryIndex index.cgi index.php
# 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
Folder stucture is like this
./wp-content
./wp-admin
./...
./...
./bot
If it is an .htaccess issue, you can create another .htaccess file in your test folder and override the settings from its parent.
You may need to add the following to your parent .htaccess file in order to enable cascading:
AllowOverride All
http://httpd.apache.org/docs/2.2/mod/core.html#AllowOverride

wordpress site ignoring sub directory when htaccess present

To begin I did not setup the website I am currently working on, and I am not very familiar with the wordpress setups. I have been called in on their site to add an admin section to this site which uses a Wordpress configuration. If I add a sub-directory, I can access the sub-dir via web just fine. The problem comes when I add a .htaccess to that subdirectory for Auth purposes. When I do this, and try to access the sub-directory, it errors to a 'Page Not Found'.
Can someone please help? I assume it is something with the Wordpress .htaccess file provided below:
# 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
UPDATE
When the .htaccess in the sub directory is blank, I can access the sub-directory via web just fine.
.htaccess (when filled out) in sub directory is below:
AuthType Basic
AuthName "Sphere"
AuthUserFile "/path/to/htpasswd"
require valid-user
I just tested a setup based off of your question. Here's an example of the hierarchy from what I could gather in your post:
public_html/ (all WP install files here)
public_html/admin/ (here I created a new folder similar to your question)
public_html/admin/index.php (test file - just echos a line of text)
public_html/admin/.htaccess (currently blank)
So my .htaccess within the new subdir that's spawned off of the WP root is blank. I'm not sure what kind of auth things would/should be in there. If I access "website/admin/" - the test line echos just fine. I don't see any 404s.
Could you maybe provide a little more detail so I can try to better replicate the issue you're seeing?
Found the solution for my problem elsewhere. Editing the root .htaccess (for wordpress) to match the one below should fix anyone who also encounters this issue:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/NameOf_Directory_ToAllow/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/NameOf_AdditionalDirectory_ToAllow/(.*)$ [OR]
RewriteRule ^.*$ - [L]
</IfModule>
<IfModule mod_rewrite.c>
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Resources