Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Wordpress separate folder

Posted on 2013-06-17
16
Medium Priority
?
287 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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
 
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 1000 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 1000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
This article discusses how to implement server side field validation and display customized error messages to the client.
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

636 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