Install Wordpress as a subfolder inside Laravel - wordpress

I run a Laravel based website and need to host a Wordpress blog on the same domain as http://example.com/blog
By placing the "blog" directory inside the public directory of the Laravel project, I get into an infinite redirect loop error.
How do I fix this?

Add this line into the .htaccess file inside your Laravel "public" folder and it should then exclude the /blog/ so you can have your own settings for it inside the blog folder.
RewriteCond $1 !^(blog)

Related

How to make Reactjs homepage default as WordPress homepage in WordPress?

I have created a page in Reactjs that is a copy of my website's home page. Now I have to make Reactjs page as default page in WordPress site. I need to remove WordPress default homepage and need to add React page.
I just created a build for react code and put that build folder in WordPress root folder and then run the script like http://localhost/my-domain/build it is working fine.
But I want to remove that build folder and want to run straight its code in root folder.
I googled but did not found any solution.
Add the following below the RewriteBase line in your .htaccess file in your WordPress root directory:
RewriteRule ^$ http://localhost/mydomain/build/ [L,R=301]

Disable all parent htaccess

I have wordpress installed in the root of my website public_html
Although I have other folder inside a projects folder running their own websites.
The .htaccess in the wordpress folder (parent-most folder) might be causing issues for the inside folders.
Is there a way, I can mention for a folder not to look any higher for htaccess files ?
DETAIL:
The two main issues I am currently having our
- if I set the status code to 500, I am get redirected to my home page (index.php)
- if a page is not found, it gets redirected to index.php
Thanks.
Put this code in your .htaccess under DOCUMENT_ROOT directory (just above your wordpress rewrite stuff):
RewriteRule ^subfolder(/.*|)$ - [L]

rewrite problem : put magento inside drupal installation directory

I have put magento inside a drupal installation in a subdirectory called store.
When I access http://localhost/myshop/store magento home page is showed without problem but when i try to access any link inside magento (example http://localhost/myshop/store/admin) i get a drupal page that tells me that the page is not found !
What should I do to make all request under /store path be dispatched to magento insted of drupal ?
edit your .htaccess rewrite path to be /myshop
############################################
## you can put here your magento root folder
## path relative to web root
#RewriteBase /magento/
look for this in .htaccess and uncomment RewriteBase and change /magento/ to your directory name
In the .htaccess file for Drupal - that is, /myshop/.htaccess - add the following before the line with RewriteRule in it.
RewriteCond %{REQUEST_URI} !^/store/
This excludes your Magento directory from Drupal's rewriting and so allow Magento to continue as normal. You shouldn't need to change Magento's /myshop/store/.htaccess file for this.

WordPress pages outside install directory

I have WordPress installed in a subdirectory and I'd like one WordPress page to appear as if it's on the root.
Eg.
/wordpress/mypage
To appear as:
/mypage
Assuming you're on Apache, and you've got permalinks already working, you can use an .htaccess file in your document root to rewrite yoursite.com/wordpress/mypage to yoursite.com/mypage.
If you don't already have a .htaccess file in your document root, create one and put this in:
RewriteEngine on
RewriteRule ^mypage$ wordpress/mypage
I'm no .htaccess expert, but that should do the trick.

How to set Wordpress and index.php to WP site

I have a running website and now i like to use WP for a couple of sub website/pages. So i am installing WP in subfolder, but now i am a bit clueless how to set up my index.html and .htaccess
I guess i need to make index.html to index.php so i can add
require('./wordpress/wp-blog-header.php');
but that would load WP and not my running website.
Any advice on how to be able to run these URI as WP pages
mydomain.com/example-1
mydomain.com/example-2
mydomain.com/wpwebsite
regards
You can install WordPress in your subfolder, maybe /wordpress/, then you can change the index.php in your /wordpress/ folder from:
require('./wp-blog-header.php');
to:
require('./wordpress/wp-blog-header.php');
move index.php and .htaccess from your /wordpress/ folder to your main folder, now you should be able to change the pages. The other pages you would like to add without WordPress:
Create .php / .html files and put it in the main folder, these should be available, if you call the url of the .php / .html file.
The best way is to use WordPress for all your pages.

Resources