Solved

Wordpress separate folder

Posted on 2013-06-17
16
242 Views
Last Modified: 2013-07-20
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
Comment
Question by:solsticeint
  • 8
  • 6
  • 2
16 Comments
 
LVL 82

Expert Comment

by:hielo
ID: 39253231
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
 
LVL 17

Expert Comment

by:jrm213jrm213
ID: 39253239
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
 

Author Comment

by:solsticeint
ID: 39253241
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
 

Author Comment

by:solsticeint
ID: 39253257
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
 
LVL 82

Expert Comment

by:hielo
ID: 39253271
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
 

Author Comment

by:solsticeint
ID: 39253290
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
 
LVL 82

Expert Comment

by:hielo
ID: 39253320
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
 

Author Comment

by:solsticeint
ID: 39253332
Still the same.  

Michael
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 82

Expert Comment

by:hielo
ID: 39253333
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
 

Author Comment

by:solsticeint
ID: 39253362
That did not work either.  There is not another access file.  Sorry for the pain here.
0
 
LVL 82

Accepted Solution

by:
hielo earned 250 total points
ID: 39253827
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
 
LVL 17

Assisted Solution

by:jrm213jrm213
jrm213jrm213 earned 250 total points
ID: 39253866
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
 

Author Comment

by:solsticeint
ID: 39254729
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
 

Author Comment

by:solsticeint
ID: 39254769
Is there another file in wordpress that could be getting the file from opening?  Another access type file.

Michael Zury
0
 

Author Comment

by:solsticeint
ID: 39254899
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
 
LVL 82

Expert Comment

by:hielo
ID: 39255080
Hmm, I would shift my attention to the httpd.conf file and whatever other *.conf files it is including.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
php string masking 4 29
get domain with php 7 20
Facial recognition to look through the whole database for a person 3 43
WP_Query multiple custom taxonomies 5 28
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now