0

I have installed WordPress in the main domain uberchecker.com and installed a PHP script in uberchecker.com/app, Now when I try to access any app. I'm getting the error that page not found as it shows the Wordpress site...

How do i show the app page instead of the WordPress site showing me a 404 page?

My .htaccess file in the Wordpress root folder looks like this

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/app/(.*)$ [OR]
RewriteRule ^.*$ - [L]
</IfModule>
1
  • You can use Wordpress template to write your php script and then use on wordpress as a page Commented May 7, 2020 at 8:05

1 Answer 1

1

I'm not 100% sure what you mean, but if you want a separate script in a Wordpress directory, you can add a folder to the root of the directory called app, and place an index.php inside that folder like.

wp-admin/
wp-includes/
wp-content/
index.php
app/
-- index.php

The above will result in www.wordpressinstallurl.nl/app showing the contents of app/index.php

Secondly you also want to update your htaccess to prevent wordpress from routing all request to subfolders to the root index.php, you can do this by adding the following above the wordpress directive:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/app/(.*)$ [OR]
RewriteRule ^.*$ - [L]
</IfModule>


<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Sign up to request clarification or add additional context in comments.

11 Comments

Hi, That is precisely what i have done.. but the problem is when i try to access the page of a script, like this wordpressinstallurl.nl/app/exampleapp1. i get a 404 error as it tries to show me the Wordpress page instead of the script page. You an check my links. uberchecker.com -wordpress--works, uberchecker.com/app- script installed--works, uberchecker.com/app/meta-tag-generator --gets 404 error.
My bad, I added some extra info to my answer, you wan to make some changes to htaccess aswell!
i created the .htaccess as you said..in the Wordpress folder..but that didn't work.
Could you add your complete htaccess in your question so I can take a look at it?
I have added it to the question. The htaccess content is just the same as what you initially told.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.