Reputation: 351
I have a non-wordpress site where i installed wordpress in a subdirectory
www.example.com/wordpress/
I have created an htaccess file in the wordpress folder (whre i have all its content)
# 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
And made this change in the index.php (inside wordpress folder)
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define('WP_USE_THEMES', true);
/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . './wordpress/wp-blog-header.php' );
The admin works ok but when try to visit the site it gives me an error 500. what am i missing?
Aclaration: I want to use wordpress in this url www.example.com/wordpress/ since i have other content in the root.
Upvotes: 0
Views: 2526
Reputation: 389
I would suggest to always look at the php error log as it usually tells you a lot more than any forum. I just had a similar problem where everything was working fine untill at some point only the home was showng up correctly.
Somehow Wordpress doubled the redirects in .htaccess and it was causing a loop.
You should only have this in your .htaccess (unless you know what you are writing there).
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?put_here_your_websitename_dot_tld$
RewriteCond %{REQUEST_URI} !^/c/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /put_here_your_subfolder/$1
RewriteCond %{HTTP_HOST} ^(www.)?put_here_your_websitename_dot_tld
RewriteRule ^(/)?$ put_here_your_subfolder/index.php [L]
</IfModule>
Be sure there is no Wordpress generated stuff. Also, this .htacces should be on the root directory and not on the subfolder and remember to modify the link in the wordpress admin panel (under settings>general)
I know this is an old question but I tought this could help someone.
Upvotes: 0
Reputation:
Remove /wordpress from the last rule (RewriteBase stays as before).
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Upvotes: 1
Reputation: 13
Error 500 is Internal Server Error Internal server error in WordPress is often caused by plugin and/or theme functions. Other possible causes of internal server error in WordPress that we know of are:
Possible Solutions:
Upvotes: 0
Reputation: 2210
The admin works because, admin does not need htaccess to run properly, there's rewrite invoke for it.
Your .htaccess runs in your folder wordpress, rewrite in it, is valid for this folder. I do it like that every time, I never edit it, except if ssl is enable for the domain.
If you index.php is in your wordpress folder, you don't need to it like you do, you only need to require('wp-blog-header.php');
, these files are in the same folder.
Upvotes: 0
Reputation: 185
Assuming you've updating your permalinks(or copied the htaccess file it provided you), take a look at your error logs, as an error 500 should produce an error in the logs.
For Apache servers on Linux and Mac, the error logs can be found at: /var/log/apache2/error_log
Upvotes: 1