Forums / General Questions / Any way to determine what file is rewriting index.php to root?

Any way to determine what file is rewriting index.php to root?

Views: 1,525

Results 1 to 12 of 12
30 Mar 2012, 2:55 AM
#1
lynhend avatar

lynhend

New Zenner

Join Date:
Mar 2012
Posts:
5
Plugin Contributions:
0

Any way to determine what file is rewriting index.php to root?

I just purchased a website that uses Zen-Cart. Zen Cart was set up to run in the root directory instead of a store directory. When the site was designed, it had an index.html page as the home landing page and then the zen cart shop was called from the top navigation.

I had the CEON URI rewrite module installed on my site to help with SEO and ever since, the index.php page is the first page that comes up when browsing to the site using the root directory.

I've tried multiple different things in the .htaccess file to try and get the index.html file to show up first to no avail. I have made a couple of changes that lets the index.html file show first, but then when I click on the index.php link, it goes back to the root which then goes to index.html and my users can't get to the shopping area.

Anyway, I think there must be another file somewhere that is rewriting index.php to the root. I've searched and can't find anything that is doing it. Is there a way to determine which file is rewriting index.php to the root?

In case it helps, here's my .htaccess file for you to pick apart:

DirectoryIndex index.html index.php index.htm

Options +FollowSymLinks
RewriteEngine On

Rewrite https://www.weddedglitz.com to weddedglitz.com (strip the www)

RewriteCond %{HTTP_HOST} ^www.weddedglitz.com$ [NC]
RewriteRule ^(.*)$ http://weddedglitz.com/$1 [R=301,L]

BEGIN CEON URI MAPPING REWRITE RULE

RewriteEngine On

Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])

RewriteCond %{REQUEST_URI} !.[a-z]{2,5}$ [NC]

Don't rewrite any URIs for some, popular specific file format extensions,

which are not covered by main file extension condition above

RewriteCond %{REQUEST_URI} !.(mp3|mp4|h264)$ [NC]

Don't rewrite any URIs for some specific file format extensions,

which are not covered by main file extension condition above

Uncomment the following line to apply this condition! (Remove the # at the start of the next line)

#RewriteCond %{REQUEST_URI} !.(3gp|3g2|h261|h263|mj2|mjp2|mp4v|mpg4|m1v|m2v|m4u|f4v|m4v|3dml)$ [NC]

Don't rewrite index.html

RewriteCond %{REQUEST_URI} !^index.html [NC]

Don't rewrite index directory

RewriteCond %{REQUEST_URI} !^index.php [NC]

Don't rewrite admin directory

RewriteCond %{REQUEST_URI} !^/wgadministration [NC]

Don't rewrite editors directory

RewriteCond %{REQUEST_URI} !^/editors/ [NC]

Don't rewrite home1 directory

RewriteCond %{REQUEST_URI} !^/home1/ [NC]

Don't rewrite cgi-bin directory

RewriteCond %{REQUEST_URI} !^/cgi-bin/ [NC]

Don't rewrite FontViewer directory

RewriteCond %{REQUEST_URI} !^/FontViewer/ [NC]

Don't rewrite custom directory

RewriteCond %{REQUEST_URI} !^/custom/ [NC]

Don't rewrite inspiration directory

RewriteCond %{REQUEST_URI} !^/inspiration/ [NC]

Don't rewrite bmz_cache directory

RewriteCond %{REQUEST_URI} !^/bmz_cache/ [NC]

Handle all other URIs using Zen Cart (its index.php)

RewriteRule .* index.php [QSA,L]

END CEON URI MAPPING REWRITE RULE

If you want to look at the site to see what I'm talking about, the link is WeddedGlitz.com. Any help would be greatly appreciated.

Thanks,

Lyn Henderson
WeddedGlitz.com

30 Mar 2012, 10:17 AM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Any way to determine what file is rewriting index.php to root?

I don't use any sort of URL rewriting, so I can't help there, but I wonder if it wouldn't make a lot more sense to move the Inspiration and About pages to EZ pages in Zencart, integrate the Blog, and eliminate the 'jump' page altogether ?

30 Mar 2012, 12:55 PM
#3
lynhend avatar

lynhend

New Zenner

Join Date:
Mar 2012
Posts:
5
Plugin Contributions:
0

Re: Any way to determine what file is rewriting index.php to root?

The About Us page is already an EZ page.

I'll have to look at the inspiration page and also try to figure out a way to integrate the blog. I've wanted to integrate the blog since I bought the site. I think I'm losing some link juice for my main domain by having it hosted elsewhere.

I'm very new to Zen Cart and PHP so I'm not sure how to do some of this. I'd be OK with not having the index.html landing page if I could take some of that content and move it to the top of the index.php page.

Thanks,

Lyn

30 Mar 2012, 1:21 PM
#4
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Any way to determine what file is rewriting index.php to root?

I've used this:

https: //www.numinix.com/blog/2009/09/26/integrating-wordpress-into-zen-cart-1-3-8a/

The instructions aren't the best, but it works well once set up. You might try it first on a test Zencart site.

I know nothing about SEO, but it seems to me that others here have said that having your blog on another domain is better, so you might check that first.

2 Apr 2012, 6:56 PM
#5
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Any way to determine what file is rewriting index.php to root?

Hi,

The standard Ceon URI Mapping example rewrite rule won't rewrite any URI that appears to have an extension, so /index.html won't be rewritten, so you don't need the following two conditions (plus you missed the slash at the start anyway!):

lynhend:

Don't rewrite index.html

RewriteCond %{REQUEST_URI} !^index.html [NC]

Don't rewrite index directory

RewriteCond %{REQUEST_URI} !^index.php [NC]

You'll notice that going to /index.html on your site works as expected.

However, if you want to not have / "taken over" by the rewrite rule, you need to add the following condition to the rule:

# Don't rewrite /
RewriteCond %{REQUEST_URI} !^/$ [NC]
```All the best..

Conor
[ceon](http://dev.ceon.net)

NOTE: We are sorry that Conor is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

3 Apr 2012, 12:10 AM
#6
lynhend avatar

lynhend

New Zenner

Join Date:
Mar 2012
Posts:
5
Plugin Contributions:
0

Re: Any way to determine what file is rewriting index.php to root?

Conor,

Thanks for the reply, however, when I remove the lines you mentioned and then add the additional line, when I go to the index.php page, it still rewrites back to /. When that happens, no one can get to the shopping page.

I guess that brings me back to my original question. Is there any way to determine if there is another file that is causing the index.php file to rewrite back to the root of the site (/)?

One other question, would canonical links cause this behavior? If the canonical link for the index.php page is http://weddedglitz.com, would it rewrite back to root? If so, is there any way to change the canonical link for the index.php page?

This is what I ended up with in my .htaccess file that doesn't allow the shopping cart (index.php) to be accessed.

DirectoryIndex index.html index.php index.htm

Options +FollowSymLinks
RewriteEngine On

Rewrite https://www.weddedglitz.com to weddedglitz.com (strip the www)

RewriteCond %{HTTP_HOST} ^www.weddedglitz.com$ [NC]
RewriteRule ^(.*)$ http://weddedglitz.com/$1 [R=301,L]

BEGIN CEON URI MAPPING REWRITE RULE

RewriteEngine On

Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])

RewriteCond %{REQUEST_URI} !.[a-z]{2,5}$ [NC]

Don't rewrite any URIs for some, popular specific file format extensions,

which are not covered by main file extension condition above

RewriteCond %{REQUEST_URI} !.(mp3|mp4|h264)$ [NC]

Don't rewrite any URIs for some specific file format extensions,

which are not covered by main file extension condition above

Uncomment the following line to apply this condition! (Remove the # at the start of the next line)

#RewriteCond %{REQUEST_URI} !.(3gp|3g2|h261|h263|mj2|mjp2|mp4v|mpg4|m1v|m2v|m4u|f4v|m4v|3dml)$ [NC]

Don't rewrite /

RewriteCond %{REQUEST_URI} !^/$ [NC]

Don't rewrite admin directory

RewriteCond %{REQUEST_URI} !^/wgadministration [NC]

Don't rewrite editors directory

RewriteCond %{REQUEST_URI} !^/editors/ [NC]

Don't rewrite home1 directory

RewriteCond %{REQUEST_URI} !^/home1/ [NC]

Don't rewrite cgi-bin directory

RewriteCond %{REQUEST_URI} !^/cgi-bin/ [NC]

Don't rewrite FontViewer directory

RewriteCond %{REQUEST_URI} !^/FontViewer/ [NC]

Don't rewrite custom directory

RewriteCond %{REQUEST_URI} !^/custom/ [NC]

Don't rewrite inspiration directory

RewriteCond %{REQUEST_URI} !^/inspiration/ [NC]

Don't rewrite bmz_cache directory

RewriteCond %{REQUEST_URI} !^/bmz_cache/ [NC]

Handle all other URIs using Zen Cart (its index.php)

RewriteRule .* index.php [QSA,L]

END CEON URI MAPPING REWRITE RULE

Thanks for your help.

Lyn

3 Apr 2012, 10:56 AM
#7
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Any way to determine what file is rewriting index.php to root?

Hi Lyn,

lynhend:

when I go to the index.php page, it still rewrites back to /. When that happens, no one can get to the shopping page.

Yes, Ceon URI Mapping will rewrite /index.php to / whenever the shop is at the root.

I'm afraid that you can't use both /index.html as root and /index.php as your shop's root at the same time.

You'd have to custom code Ceon URI Mapping to have that.

Sorry, there is no other solution for you if you want that.

The other alternative is to move your shop into a subfolder, e.g. /store or /shop and have all URIs start with /store or /shop.

Or to forget about index.html altogether and customise your shop's front page to be the site's front page.

They are your only options so I hope you don't mind but this will be my last post about this.

All the best...

Conor
ceon

NOTE: We are sorry that Conor is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

3 Apr 2012, 10:42 PM
#8
lynhend avatar

lynhend

New Zenner

Join Date:
Mar 2012
Posts:
5
Plugin Contributions:
0

Re: Any way to determine what file is rewriting index.php to root?

Not a problem, Conor.

I'm just glad to know that they both can't coexist in the same directory. I've scoured the web and forums and couldn't find that direct answer.

I'll have to look at the options to see how I'd like to proceed.

It may be easiest just to add the content from the index.html page to the top of the index.php page and forget the index.html page altogether.

Again, I appreciate your help and will definitely be donating soon to your project. It's been very handy.

Thanks,

Lyn

3 Apr 2012, 11:30 PM
#9
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Any way to determine what file is rewriting index.php to root?

lynhend:

I'm just glad to know that they both can't coexist in the same directory.

They can co-exist... only that MOST browsers will default to index.html ahead of index.php. URL re-writing of course adds a layer of additional headaches, as you have described above.

lynhend:

It may be easiest just to add the content from the index.html page to the top of the index.php page and forget the index.html page altogether.

Well... you don't add the content to index.php . That is purely a functional files that kicks everything into life. It is NOT a repository of, or for, flat HTML.

What purpose does your original index.html file serve? Is there a "flat html" site behind it? Or is it just a landing page?

If it is just a landing page, with a link to the shop, then it is adding an unnecessary additional step to your visitor's experience, and in the world of eCommerce, you do everything you can to MINIMISE the number of steps a person has to take to buy stuff.

It could also be bad for "SEO", but that is a separate issue...

20 years a Zencart User

4 Apr 2012, 12:24 AM
#10
lynhend avatar

lynhend

New Zenner

Join Date:
Mar 2012
Posts:
5
Plugin Contributions:
0

Re: Any way to determine what file is rewriting index.php to root?

The index.html page is only a landing page. There is no additional content behind that page that can't be reached from other pages on the site.

I guess my main concern is that the current index.php file has very little text on the page. It has no welcome message, no marketing copy, and that is where most of my social linking has been placed.
I'd like to have some information on the page that will be more keyword intensive to help with SEO.

I agree with you that fewer steps to get someone to purchase is desired. I'd just like to be able to take advantage of both going to the front page of the store but also providing keyword rich data on the page as well.

Thanks,

Lyn

4 Apr 2012, 1:10 AM
#11
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Any way to determine what file is rewriting index.php to root?

In your zencart ADMIN CONSOLE, look under the TOOLS MENU and go to DEFINE PAGES EDITOR

Open the define_main_page.php for editing and add content to your heart's content...

There are numerous sidebox modules available that can carry additional content. The late (and great) Clyde Jones's TESTIMONIALS MANAGER is a good one... Google like this one.

You can build your own sideboxes using BLANK SIDEBOX and CLONES of it, to contain reams of content if you wish...

There are scores of ways of adding good, relevant and topical content to your site, and the home page is no exception....

20 years a Zencart User

4 Apr 2012, 1:23 AM
#12
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Any way to determine what file is rewriting index.php to root?

Proper SEO is not just about landing page keyword optimisation. Google now looks at it very differently, and considers a wider range of contextual issues regading how it evaluates and ranks a site.

Go to THIS SITE, and spend a minute looking at the main (landing page).

Then go to google.co.uk and put this into the search field:

refurbished heating spares

(That is a critical phrase GENERIC for the website you just visited)

What appears on Google's search results in positions:-

  • 1
  • 2
  • 3

What's quite interesting is that on Ignites home page, there is no content phrase that contains exactly refurbished heating spares.

Yet that phrase returns FIVE results* on page one of google.

**Positions 7 and 9 are relative to ignite, but link elsewhere.*

If you are not located in the UK, Google may return different results. But as my client is UK based, those rankings are relevant for this region.

20 years a Zencart User