I've installed a second instance of wordpress in a subdirectory but when I try to access mysite.com/newsite I get a 404 error page on the root wordpress install page/theme. I've looked at the .htaccess files which have rewrite rules, tried adding an exception for the /newsite folder in the root .htaccess but it had no effect.
Can someone help with this?
Did you try this set of instructions? According to that site, the .htaccess in the second installation should look like this:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /newsite/
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /newsite/index.php [L]
</IfModule>
# END WordPress
Try that out if you haven't and let me know if it works.
Related
I have import on my local webserver a backup of a website made using WordPress but I am finding some difficulties with PermaLink configuration
The main problem is that if I use the permalink setted as Article Name I can see the homepage but if I click on the articles links into the homepage (to see the article) I always obtain the following message error:
Not Found
The requested URL
/wordpress35/2012/10/11/se-milano-avesse-il-mare-anzi-no-la-montagna-di-campiglio/
was not found on this server.
If I instead I use the Default settings for permalink (http://localhost/wordpress35/?p=123) I have no problem and I can access to the articles in my website
I think that this is a .htaccess problem. Can you help me to create an .htaccess file that solve this problem?
My actual .htaccess file is:
# 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
I need to use the URL format described as: http://localhost/wordpress35/my-article-name
Did you try creating a the wordpress .htaccess for your needs?
# 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
This should work if you didn't specify any change in the website's URL.
(If the homepage is still http://localhost/wordpress35/ )
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
I have installed Wordpress inside Cakephp's /app/webroot/blog/ folder and changed the wordpress permalink settings to Month and name (eg. http://abc.com/blog/2013/02/sample-post/).
Now when i am viewing a post i am getting Missing Controller(Error: BlogController could not be found).
I want to change the cakephp routes so that anything with /blog/* will point to webroot blog folder.
Can anybody help me on this?
When we change the permalink settings of Wordpress, it generates a .htaccess file, if there is required permission else we have to create it.
In the above case there was no .htaccess file inside /blog/ folder. I created it with the following mod_rewrite rules as provided by Wordpress while changing permalink settings.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
After this every thing works fine.
There is no need to put the blog folder in webroot folder. You can access your folder by making slight changes in your .htaccess file. Just put your wordpress folder on root of cakephp with app folder and change .htaccess as given below.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule (blog/.*) $1 [L] # adjust the regex to what you want.
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
I tried both the above codes but none work for me.. then i found something by my own and it worked..So here it is ,, hope this will help some.
First Add the WordPress folder inside the webroot folder as blog. Inside blog paste the WordPress directories and files.. install the WordPress.. Now you will see in the WordPress admin general settings WordPress Address as http://cakephp/blog/app/webroot/blog, Change it to http://cakephp/blog. Save it ..
Now look for the .htaccess file in WordPress install root folder change RewriteBase and RewriteRule (last one ) to RewriteBase /blog/ and RewriteRule . /blog/index.php [L]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
I've installed my wordpress site on a separate directory and followed all the steps described here and now I can access my site from my main domain. So, my Wordpress site is installed under: www.mysite.com/wp-site/ and now I can access my site under www.mysite.com, so all is great, exactly what I wanted. Wordpress is making this happen through an .htaccess file it creates that has the necessary code to make the redirection happen (SEE CODE BELOW).
My problem is that I have other directories on my site, such as www.mysite.com/another-directory-unrelated-to-wordpress/ that I cannot access anymore because I believe wordpress and the .htaccess file it created is redirecting everything to the root.
How can I avoid Wordpress from redirecting all my other subfolders and files? Thanks a ton for any ideas or help.
Here is the htaccess file 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
The way the WordPress .htaccess file works is if an existing file or directory is requested, it does not send the request through WordPress...that's what the !-f and !-d RewriteCond statements do.
So, there is something else going on with your site. Have you used Firebug or any other debugging tool to see what is happening with the request/response?
You could always enable mod_rewrite logging to see if that gives you a clue.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteLog "rewrite.log"
RewriteLogLevel 3
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
A RewriteLogLevel of 5 would give you the most information. Make sure to comment out or remove the RewriteLog* lines when you have figured out the issue.
UPDATE: Check this other SO answer to see if it resolves your issue
I have a WordPress installation with an .htaccess file that looks like this:
# 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 tried installing a fresh copy of WordPress into a subdirectory for a separate blog and am getting 404 errors within the root WordPress when I try to view it. I'm assuming this is because of the .htaccess file.
How do I change it so that I can view the subfolder?
For future reference, you may want to try this:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog2/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog2/index.php [L]
</IfModule>
# END WordPress
Edit#2: ok i think i figured this out, but it's pretty messy.
modify your base wordpress install's .htaccess file to look like this:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/blog2/.*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
now, load a new copy of wordpress into "blog2/", and copy your wp-config.php file over to it. edit the "/blog2/wp-config.php" file and change the $table_prefix to something different than your first blog. (this will install both wordpresses into the same database).
once you've done that, you should be able to go to:
http://yourdomain.com/blog2/
and finish up the installation without issue. the initial problem was that the new copy of wordpress kept trying to use the first copy's wp-config.php file. moving it over manually fixed that all up.
because i'm insane, i tested this with two fresh copies, wrote a few test articles, and was able to navigate around without issue, so it should work :)