rewrite problem : put magento inside drupal installation directory - drupal

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.

Related

Install Wordpress as a subfolder inside Laravel

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)

Elgg with within subdirectory that is not executed by elgg

I have website that run elgg in root directory.
But I want into subdirectory that is located within elgg put wordpress site.
Example:
www.mysite.com - elgg,
www.mysite.com/wp - wordpress
Yes, and I don't need any kind of integration between them (no bridge)
Just to elgg not to execute this folder
So I need for directory www.mysite.com/wp different rules than for rest site.
I tried changing .htaccess file for www.mysite.com/wp directory, but I think it's wrong way.
It is working only for simple .php files, but wordpress is more complex and after long period of loading It show elgg "nothing found" site loaded.
Please don't ask change site structure, it is already set. And wordpress in subdirectory also has it's reasons.
I know there must be easy solution for this issue like elgg plugin for subdirectories, but problem is that web is flooded with topics about installing elgg in subdirectory and I can't find solution.
You can use a rewrite rule that uses ^$ to represent the root and rewrite that to your /wp directory, and write this just above index.php like this:
RewriteEngine On
RewriteRule ^wp(.*)$ /wp [L]
RewriteRule ^(.*)$ index.php?__elgg_uri=$1 [QSA,L]

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]

URL rewriting For WordPress - Integrating Non Wordpress site with wordpress

We are unable to change the url rewriting to integrate an exsiting directory site into my wordpress site.
WordPress is fixing everything to their url pattern.
How can I help my programmer? Can someone give an advise?
More details would be useful, but in all likelihood, add a do nothing and stop rule for your folder before the WP rules:
RewriteEngine On
RewriteBase /
RewriteRule ^folder - [L]
We integrate WordPress with Ruby-on-Rails on ICanLocalize.
This is done in the Apache config file. Use the Apache Alias command to indicate that a path comes from a different physical directory.
Then, the URLs that match that path will never go to WordPress. They will be served from the other physical directory, where you can place anything.
If you need to take a subdirectory out of the url-rewriting from wordpress, put an additional .htaccess file into that directory and switch the Rewrite-Engine off:
RewriteEngine Off
That directive overrides any settings of the wordpress .htaccess for that directory and it's subdirectories.
You find the longer version of my answer in a related question on wordpress answers with a slightly different .htaccess code.

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.

Resources