LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-27-2010, 07:28 PM   #1
nortonz
LQ Newbie
 
Registered: May 2010
Location: North ID. USA
Distribution: Fedora 12
Posts: 24

Rep: Reputation: 15
Rewrite Engine on, won't load the index.php.


I have been working on this for the last couple of days, but I don't seem to be getting anywhere with it.

I have a Fedora 12 64bit Server set up, and for the most part it's working Great. I have 3 VHost set up, and no problems with that.

My problem is I just moved my Wife's xcart store from Godaddy to this server. And the store works great. But xcart is set up to use Clean URL's, and this is what I seem to be having all the problems with.

in my "httpd.conf" file, I have "AllowOverride All" to use ".htaccess" and in xcart ACP I have it set to use Clean URL's. I added a ".htaccess" file to root folder, with this in it.

Quote:
DirectoryIndex home.php index.php index.html index.htm
Options +FollowSymLinks -MultiViews -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{ENV:REDIRECT_STATUS} !^401$
RewriteCond %{REQUEST_URI} !^/(payment|admin|provider|partner)/
RewriteCond %{REQUEST_FILENAME} !\.(gif|jpe?g|png|js|css|swf|php|ico)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ dispatcher.php [L]
</IfModule>
# /Clean URLs ]]]
Now if you try to log in to the store with just the base url "www.my_site.com/" I get a the Apache Test page. But if I enter "www.my_site.com/index.php" the Home page opens, and all clean url's from there work fine. ALL other pages will open just fine. So clean URL's is working. Its just the home page that won't load right.

Now if I change the ".htaccess" file, and set "RewriteEmgine Off", then the home page will load like it should with the base url., but then "Clean URL's" no longer work. I have to change "AllowOverride All" to "AllowOverride None" and turn Clean URL's off in the ACP of xcart. to get the store working again.

Then the whole site works just fine, just No Clean URL's
I'm at my wits end with this, don't know what else to try to get this to work. So I was hoping someone here might have an answer, or at least some ideas to try. This all worked just fine on GoDaddy's site, I left because it was just too dam slow. It took a minute and a half just to load the Home Page. On my server its less that 2 seconds. And every time I asked them about it, it would speed up for a few days then slow down again. But the same .htaccess file worked on that server. So I think my problem is in my "httpd.conf" file just don't know where.

I can post the file if you like.

Thank you for any help on this.

Regards,
Michael
 
Old 06-27-2010, 09:57 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Could you try adding:

RewriteCond %{REQUEST_URI} !^/$

..to the list ?
 
Old 06-27-2010, 10:46 PM   #3
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
I assume the site is a virtual site ?
If so, why is the rewrite base set to / ?
It should be set to /path/to/virtual/site/document/root/

This is why you get the main apache page for the server.
 
Old 06-28-2010, 12:06 AM   #4
nortonz
LQ Newbie
 
Registered: May 2010
Location: North ID. USA
Distribution: Fedora 12
Posts: 24

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by kbp View Post
Could you try adding:

RewriteCond %{REQUEST_URI} !^/$

..to the list ?
Thanks for the Reply kbp, I added that line to the .htaccess file, but it does exactly the same thing, when I try to log on to the home page, I get Apache test page instead of the home page. If I add the index.php to the url the home page comes up. All other page still work fine. Its just the home page.

Michael
 
Old 06-28-2010, 12:24 AM   #5
nortonz
LQ Newbie
 
Registered: May 2010
Location: North ID. USA
Distribution: Fedora 12
Posts: 24

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by smoker View Post
I assume the site is a virtual site ?
If so, why is the rewrite base set to / ?
It should be set to /path/to/virtual/site/document/root/

This is why you get the main apache page for the server.
Thank you for the reply Smoker, I have tryed this also, and different variations of that line, but all it does is brake everything. I can access the home page onlt with "www.my_site.com/index.php" but none of the other pages will come up at all.
"RewriteBase /" this is the Document Root..


This .htaccess file is the same one I used on the last server I put together, and it worked fine on it..I still think it is something in my "httpd.conf" file..

I have copyed, and zipped my httpd.conf file to one of my other site, if you want to download it, look at it to see if you can figure out what I have done wrong. You can get it here. http://www.asrservice.com/httpd_conf.zip

Michael
 
Old 06-28-2010, 12:32 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

To me it looks like somehow the apache test page takes precedence over index.php.
You can (re)move it, so index.php, will be used as a DirectoryIndex

Regards
 
Old 06-28-2010, 11:09 AM   #7
nortonz
LQ Newbie
 
Registered: May 2010
Location: North ID. USA
Distribution: Fedora 12
Posts: 24

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
Hi,

To me it looks like somehow the apache test page takes precedence over index.php.
You can (re)move it, so index.php, will be used as a DirectoryIndex

Regards
Thanks for the Reply, I was able to solve the problem by adding a line to my "httpd.conf" I added AddType text/html .php, and not everything is working as it should.

Thanks to everyone that replied to this post..

Michael
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2 won't load index.php files foucault Linux - Software 11 03-20-2010 09:08 PM
Rewrite engine bcrossb Linux - Newbie 2 03-20-2009 12:43 PM
Apache 404 index.php not Found but index.php exists at document root mark84 Linux - Server 20 07-27-2008 01:55 AM
Apache2 won't load index.php files poojatangi Linux - Software 0 07-09-2008 06:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration