Solved

Wordpress separate folder

Posted on 2013-06-17
16
255 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
The viewer will learn how to count occurrences of each item in an array.

696 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