I have Magento installed on the root of my server.
I have Wordpress 4.0.1 installed on a sub-folder /blog
With permalinks set to default e.g. ?p=123 posts load correctly
With permalinks set to post name e.g. /blog/%postname%/ I get the 404 error from the Magento store
I've attempted to introduce an .htaccess file into the /blog folder with some settings in it, however as yet, I'm unable to set pretty permalinks and get the relevant post page to appear.
Any suggestions on what needs to be in the .htaccess file or howelse to resolve this issue?
Make sure you have following code in .htaccess which is in folder /Blog :
# 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
Related
I have Magento 2 and want to setup WordPress in a subfolder, so it will be accessed via magento2.url/blog
I know about Fishpig but for my situation, it will not work because WordPress site has a lot of custom post types which is not supported by FishPig integration by default.
Right now if I tried to access magento2.url/blog it shows a 404 error Magento 2 page.
I modified .htaccess in WordPress subfolder to this:
# BEGIN WordPress
<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>
# END WordPress
But it not helps and home page for WordPress still shows a 404 Magento 2 page. I think I need to modify .htaccess in Magento 2 but not really sure how.
The .htaccess is irrelevant when integrating WordPress into Magento. This file only applies when accessing WordPress directly (ie. for a WordPress Admin request).
Here are basic installation instructions:
Install WordPress in a sub-directory of Magento called wp.
If you use the pub directory to display Magento, either install WordPress at pub/wp or create a symlink at pub/wp to point to the actual wp folder.
Check the wp_options table for the home and siteurl values. The siteurl value should be the /wp URL and the home option should be your /blog URL
This is all you need to do to integrate WordPress at /blog.
The .htaccess file has no impact here, however you should change /blog/ to /wp/ in the .htaccess for WordPress. The correct value is:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wp/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp/index.php [L]
</IfModule>
# END WordPress
For a full installation guide, see this link.
For case if using Apache.
install Magento
install Wordpress to subfolder blog
add to .htaccess & pud/.htaccess following code
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
In folder pub create symbol link like
ln -s /var/html/blog /var/html/pub/blog
As answered on https://magento.stackexchange.com/a/53757 you should install WordPress outside the Magento directory.
Despite of that, in your case you must edit Magento .htaccess because WP can't be accessed wich explains the Magento 404 error.
RewriteRule ^/blog/(.*) /blog/$1 [QSA]
I'm working on a Wordpress website and I was looking for having a permalink with the name of the publication of my articles. I selected on the permalink option "Name of the publication". Since this modification, I'm not able to access to the different pages / articles on my website.
I know that problem can occur when we don't have the mod_rewrite loaded. I created an info.php and I saw in the list of the Loaded Modules "mod_rewrite". I also tried to modify the htaccess file and it still not working.
# 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
Do you have an idea?
Thank you
Create a backup of your .htaccess (.zip it) then, delete your .htaccess. After deleting, click save permalink.
I am developing a website using WordPress. When you go to pages, it displays a index.php in the URL before the page name.
For example:
http://hci2018.bcs.org/index.php/register/
But it should be
http://hci2018.bcs.org/register/
How do I remove the index.php?
Please change the Permalinks of the site:
Go to Setting in the admin
and click on the permalink
Change the permalink to post name
You can get the exact URL as you want.
I have had the same problem. After enabling permalink to post name, all my pages (other than the homepage) came up as not found (404). This happened because the .htaccess file couldn't be modified by Wordpress.
I had to manually edit/modify the .htaccess file from the root folder of the website with the following:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
After I did this, everything worked as before. And no more index.php before the page name. Problem solved!
I've updated my website to a Wordpress site.
But now i have a problem with my prestashop, that i still need to be running on the server/webhost.
On my old page i had the prestashop installation called 'shop' inside my old site folder - so the link would be mysite.com/shop = worked fine.
I have nice permalinks working on my site, taking up all directions outsite WP sites as 'No result WP page' - And im stocked here..
I dont know where to put my prestashop folder or how to link to it from Wordpress.
Have you set up the permailinks in Wordpress so your .htaccess looks like 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
The line RewriteCond %{REQUEST_FILENAME} !-d is telling the server not to include rewrites for directories which are in the root of the install, so anything within your shop directory shouldn't be processed through index.php.
I am setting up a website inside a wordpress installation folder.
So it's like:
http://mysite.com/newsite/
Primarily, http://mysite.com is a wordpress installation, now I want to set up another site*(not a wordpress website)* on that directory which is newsite,
So basically it looks like this mysite/newsite/
When I go to that link, it changes the URL and leads me to a page of mysite page. I think maybe because of the .htaccess of the wordpress installation.
How can I access on my newly setup website without being redirecting me to http://mysite.com page?
PS:
Wordpress .htaccess configuration:
# 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
Your help will be appreciated!