Disable all parent htaccess - wordpress

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]

Related

Moodle and Wordpres aren't available at the same time - Problem with htaccess?

I am using Wordpress on hosting linux (by Aruba). It's in a directory named "up". Now I installed Moodle in the same host but inside a directory named "formazione".
Installation Moodle is ok.
But I have a problem:
Immediately after the installation of Moodle, www.domain.com/formazione/index.php isn't reachable. OH NO!
I thought the problem might be in the .htaccess file available on the root. I open this file and I read:
RewriteEngine On #created by aruba do not touch this file! #ATTENTION: Remove file index.(php|html|htm) RewriteCond %{REQUEST_URI} !^/up RewriteRule ^(.*)$ up/$1 [L]
Deleting the .htacess file available on the root I get this result (it's not a solution evidently):
I noted that if I go to my domain (e.g. www.domain.com) i read a white page with "under construction" (oh no!). It's the file index.php on the root. But normally if I go to www.domain.com the home page is the index.php of the "up" directory (www.domain.com/up/index.php).
But...Now the www.domain.com/formazione page now is reachable.
Why? What can i do?
I need:
Have my www.domain.com pointing to index page of wordpress (www.domain.com/up/index.php)
At the same time, obviously, i need to reach also www.domain.com/formazione

Combining wordpress and static html

I ran into a bit of a problem today. A client of mine had a Wordpress site build, she asked me to build a new static website (html5,css,js,no wp) but have a link to the old wordpress site containing a webshop she liked to keep.
So I wanted to put my new files in the same folder, but index.php was already doing something for the wordpress site. Being the front of the WP application.
I'm not that familiar with WP, so I can't really fiddle around with it too much myself. But all the URL's for the webshop seem to pass by this file (index.php). I also have another WP site, which is a blog, in another folder. This is how my file structure looks like.
public_html
-index.php
-/shop/ -->wordpress
-/blog/ -->wordpress
-newsite.php
-/img/
-/css/
-/js/
So on my newsite.php i have a link to the directory /blog/ , but since index.php is already part of the wordpress site, it catches the url and redirects to an error page of the old wordpress site, instead of just going in the directory.
What are my options here? I tried moving the shop and index.php into a folder together and referring to that folder on my newsite.php on the link for the shop, but it just gave an access denied error.
Thanks in advance
site's online at http://www.tutuchic.be/
i think You use a mod_rewrite rule to url redirect
Options +FollowSymLinks
Options -Multiviews
RewriteEngine On
RewriteBase /
RewriteRule ^indexs.php$ newsite.php/blog/ [R=301,L,NC]

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