Redirect issue

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Redirect issue

Postby RiP » 18. January 2011 08:35

So i've downloaded xampp for windows. Inside the htdocs folder I placed two sub folders. I also renamed the default index pages so I do not automatically link to them when accessing localhost/ in my web browser.

So now I have in the htdocs folder:
start.html
start.php
xampp
site1
site2

For some reason, site2 will not show up, and I can not link to it.

Also when i go to localhost/site1 I am redirected to my actual public website... I have no idea how it even knows to redirect me to my website which is even more confusing.

So what im asking is, why doesnt site2 show up in localhost

And, why cant I access the files in site1 without being redirected.
RiP
 
Posts: 6
Joined: 18. January 2011 08:26

Re: Redirect issue

Postby Sharley » 18. January 2011 08:42

RiP wrote:For some reason, site2 will not show up, and I can not link to it.
Site2 is accessed by:
http://localhost/site2/
if you have an index file, index.html or index.php in the site2 folder.

RiP wrote:Also when i go to localhost/site1 I am redirected to my actual public website
Is there a .htaccess file in this site1 folder?
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Redirect issue

Postby RiP » 18. January 2011 08:44

I still cant access site2

Yes there is an .htaccess file
RiP
 
Posts: 6
Joined: 18. January 2011 08:26

Re: Redirect issue

Postby Sharley » 18. January 2011 08:48

How are you trying to access site2 and does this site have a .htaccess file?

The .htaccess file is redirecting to your hosted web site.
Rename the .htaccess or move it out of the folder or edit the .htaccess file and remove the redirection.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Redirect issue

Postby RiP » 18. January 2011 08:54

Both site2 and site1 are located in htdocs/

When using file:///C:/xampp/htdocs/site2/ it works fine, except it of course, doesn't read php.

When using localhost/site2/ Theres a server error [500]

In site1 there was an htaccess redirect, i removed .htaccess out of the way, but I'm still redirected, even after i clear the cache.

In site2, there is no .htaccess file.
RiP
 
Posts: 6
Joined: 18. January 2011 08:26

Re: Redirect issue

Postby Sharley » 18. January 2011 08:58

Server 500 errors are in the \xampp\apache\logs\error.log file along with any other server errors that you are encountering.

What do you see when you type http://localhost/xampp in your browser?
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Redirect issue

Postby RiP » 18. January 2011 09:01

Alright, i can see site2 now. However, site1 is still redirecting, i've checked the php scripts for redirects and thats fine. I've removed the .htaccess file and still nothing. What else might be causing the redirect.

Also one last thing, where do I find the file to add:
AddType application/x-httpd-php5 .htm .html

What do you see when you type http://localhost/xampp in your browser?

The xampp main page
XAMPP 1.7.3!

Congratulations:
You have successfully installed XAMPP on this system!

and all that other stuff
RiP
 
Posts: 6
Joined: 18. January 2011 08:26

Re: Redirect issue

Postby Sharley » 18. January 2011 09:16

RiP wrote:Also one last thing, where do I find the file to add:
AddType application/x-httpd-php5 .htm .html
This entry is only required if the server has 2 different PHP versions, php4 and php5 so it can be differentiated.
XAMPP only has 1 php version and so this entry is not required and would cause an error if you add it.
Code: Select all
AddType application/x-httpd-php .htm .html
is added in the \xampp\apache\conf\httpd.conf file under the <IfModule mime_module> section. Restart Apache after editing this file.

There is nothing in XAMPP that can possibly know how to redirect your site1 without you have configured it to do so, and only you would know that.

It must be something you have overlooked in the site1 folder files that is still redirecting.

Have you changed anything in the Windows HOSTS file?
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Redirect issue

Postby RiP » 18. January 2011 09:18

Have you changed anything in the Windows HOSTS file?


No. But now all of the sudden site1 wants to work. For future reference, why does it do that? does it take time to update the changes?
RiP
 
Posts: 6
Joined: 18. January 2011 08:26

Re: Redirect issue

Postby Sharley » 18. January 2011 09:21

RiP wrote:...But now all of the sudden site1 wants to work. For future reference, why does it do that? does it take time to update the changes?

What changes did you make? and no there is no explanation I can give you, Apache will instantly recognize changes in the httpd.conf file as soon as you restart it.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Redirect issue

Postby RiP » 18. January 2011 09:28

Alright, everything works fine, still confused why it took so long to update site1, but its fine now.

Thanks for all your help its most appreciated.
RiP
 
Posts: 6
Joined: 18. January 2011 08:26


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 93 guests