[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 303
  • Last Modified:

Wordpress separate folder

Is there a way to while in a Wordpress site have a separate folder that can run separately without information from the wordpress dbase.  I have a php program that I want to run, but am running into trouble from the wordpress installed.  At this time I do not want to put the folder into wordpress.  Is there a way to do that?
0
solsticeint
Asked:
solsticeint
  • 8
  • 6
  • 2
2 Solutions
 
hieloCommented:
read my comment on your previous question  - the one you closed too soon :)

Just so we are clear, with that approach, your the "Part Generator" application will not be "hooked/integrated" into the WP interface.  If you need the WP interface to be integrated, you will need to come up with a custom theme.
0
 
jrm213jrm213Commented:
You should be able to create a folder in the root of your site (where you see wp-content, wp-admin, etc.) then you should be able to put your code in that folder and it should run. You just have to make sure you don't create a page/post in wordpress that has that folder name as it's permalink.
0
 
solsticeintAuthor Commented:
Hielo,
  I appreciate you response.  I closed this too soon.  :-)   right now the site does not let me know if it is working, it just gives me a 404.  (http://thermal-mass-flow.com/applicationsdata)  is the new folder.  Can I move this folder outside of the data range of wordpress.  This is option 1.  

THank you,
Michael
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
solsticeintAuthor Commented:
The default is index.php.  I ran a test and the folder is there ( hi.html) but the hi2.php does not show either.  My guess is that the php is running into the issue.

Michael
0
 
hieloCommented:
There should be an .htaccess file on the root of your site:
http://thermal-mass-flow.com/.htaccess

Did you add the previously suggested rules to the top of your .htaccess file?  It needs to be at the beginning to by pass the WP rules.
0
 
solsticeintAuthor Commented:
I posted the following and still get a 404.

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/applicationsdata/?$ applicationsdata/index.php [NC,QSA,L]

# 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
0
 
hieloCommented:
I missed a leading slash on the rewrite rule.  Try:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/applicationsdata/?$ /applicationsdata/index.php [NC,QSA,L]


# BEGIN WordPress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
</IfModule>

Open in new window

0
 
solsticeintAuthor Commented:
Still the same.  

Michael
0
 
hieloCommented:
Try commenting out the line the checks for directory (line 6):
# RewriteCond %{REQUEST_FILENAME} !-d

Also, is there an .htaccess file in your "applicationsdata" folder?
0
 
solsticeintAuthor Commented:
That did not work either.  There is not another access file.  Sorry for the pain here.
0
 
hieloCommented:
The code below worked for me.  Read the comments.  You can use either external OR internal redirect.  If the code below still doesn't work, you may have a rewrite rule in the main apache config file (or one of its included config files).

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} applicationsdata/?$ [NC]
# the following rule will do an external redirect - you will see the browser's url change
RewriteRule .+ /applicationsdata/index.php [R=301,QSA,L]

# the following reul will do an internal redirect - the browser url will remain the 
# same but the desired target file (index.php in applicationsdata) processes the request
#RewriteRule .+ /applicationsdata/index.php [QSA,L]


# BEGIN WordPress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
</IfModule>

Open in new window

0
 
jrm213jrm213Commented:
I have never had to change my .htaccess file to accommodate running a php file in a subdirectory of my wordpress site.

If you could access the .html file that way you should be able to also access your php file that way. If you are getting a 404 it means the resource was not found, is it possible you mis-typed the file name?

http://www.jacquesmeyer.com/testing/index.php
http://www.jacquesmeyer.com/testing/

I am just using the default Wordpress .htaccess file
# 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

Open in new window


This is the code in /testing/index.php
<?php
echo("welcome<br/>");
?>
<p>This is index.php you can access it by typing it into the url or just by viewing the folder</p>
<p><a href="http://www.jacquesmeyer.com/testing/index.php">http://www.jacquesmeyer.com/testing/index.php</a></p>
<p><a href="http://www.jacquesmeyer.com/testing/">http://www.jacquesmeyer.com/testing/</a></p>

Open in new window

0
 
solsticeintAuthor Commented:
Tried putting both in and got the same 404.

http://thermal-mass-flow.com/applicationsdata/php.php

I would say I am in the wrong directory, but I made a change to the hi.html file and it shows fine.  It is just the php files.  I'm stumped here.
0
 
solsticeintAuthor Commented:
Is there another file in wordpress that could be getting the file from opening?  Another access type file.

Michael Zury
0
 
solsticeintAuthor Commented:
I got it to go an another wordpress site that I had.  It must be a setting in the wordpress.

Not sure where or what however!
0
 
hieloCommented:
Hmm, I would shift my attention to the httpd.conf file and whatever other *.conf files it is including.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 8
  • 6
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now