Solved

Wordpress separate folder

Posted on 2013-06-17
16
238 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

WordPress can be pretty daunting, especially for a beginner, so I thought it might be a good idea to write an article to show how easy it is to get started in WordPress and to design a custom theme.  The first step is to check with your hosting comp…
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…

707 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

12 Experts available now in Live!

Get 1:1 Help Now