Solved

php redirect

Posted on 2013-06-08
12
224 Views
Last Modified: 2013-06-12
I am using DW and I have php installed and this works (easy php)
I need to run php files but how do i set the current folders I am working to work with php?
0
Comment
Question by:jagguy
[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
  • 6
  • 4
  • 2
12 Comments
 
LVL 3

Expert Comment

by:Bogeholm
ID: 39232669
Hi Jagguy

Are you running a Local webserver? If yes, is it IIS on Windows?
0
 

Author Comment

by:jagguy
ID: 39232908
Hi,
I am running apache (easyPHP)
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39233043
Yeah okay that is just a installer for wampserver.

You just run the files using localhost:

http://localhost/yourfolder/yourfile.php

Cd&
0
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!

 

Author Comment

by:jagguy
ID: 39234196
ok but localhost points to a directory I dont want to place my php files.
I need to redirect my php dir so the files can be picked up
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39235422
Either change the wampserver config to point where you want it to point; change the location of your files, or change all the hrefs to use a path that traverses from wampsers default to your folders.

Cd&
0
 

Author Comment

by:jagguy
ID: 39236420
yes where do i do this again?
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39236452
for windows 7 the host file is generally at:

c:\windows\system32\drivers\etc\host

Cd&
0
 

Author Comment

by:jagguy
ID: 39236641
My files for php are located in e:/program files/easyPHP/www

I want the dir of this moved so I can run php files from another dir. In Php.ini or httpd.conf how do i do this again exactly?

I want to run php files in e:/website/<another folder>
0
 

Author Comment

by:jagguy
ID: 39237626
I really dont know what to do here and what setting to change so I can run php files from a dir of my choice
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39238285
The files have to be under the root.  The wampserver directory is the root.  The server cannot access or see what is not below it in the hierarchy.

You cannot do localhost/e:/website...

It must be localhost/website... and the website foler must be inside the folder where the serve is.

Cd&
0
 
LVL 3

Accepted Solution

by:
Bogeholm earned 500 total points
ID: 39239200
Hi,
To change the default 'site folder' in Apache, you need to right click on the icon on the Easyphp icon on the taskbar and select configuration->Apache. This will open httpd.conf in a notepad window

Find DocumentRoot and the section: DocumentRootDirectory and modify the path to your preferred path, Where you find the default path.

Pay attention to Where to use '/' and '\'
0
 

Author Comment

by:jagguy
ID: 39239654
This is what i did to make it work but the VirtualHost

DocumentRoot "D:/code"
(...)
# DocumentRootDirectory
<Directory "D:\code">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
 </Directory>
 (...)
 NameVirtualHost 127.0.0.1
 <VirtualHost 127.0.0.1>
   DocumentRoot "D:/code/"
   ServerName localhost
 </VirtualHost>
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

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