Results 1 to 10 of 12

Hybrid View

  1. #1
    Join Date
    Mar 2012
    Posts
    5
    Plugin Contributions
    0

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

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

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

  3. #3
    Join Date
    Mar 2012
    Posts
    5
    Plugin Contributions
    0

    Default 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

  4. #4
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

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

  5. #5
    Join Date
    Aug 2004
    Location
    Belfast, Northern Ireland
    Posts
    2,480
    Plugin Contributions
    14

    Default 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!):

    Quote Originally Posted by lynhend View Post
    # 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:

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

    Conor
    ceon

  6. #6
    Join Date
    Mar 2012
    Posts
    5
    Plugin Contributions
    0

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

  7. #7
    Join Date
    Aug 2004
    Location
    Belfast, Northern Ireland
    Posts
    2,480
    Plugin Contributions
    14

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

    Hi Lyn,

    Quote Originally Posted by lynhend View Post
    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

  8. #8
    Join Date
    Mar 2012
    Posts
    5
    Plugin Contributions
    0

    Default 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

  9. #9
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

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

    Quote Originally Posted by lynhend View Post
    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.

    Quote Originally Posted by lynhend View Post
    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

 

 

Similar Threads

  1. Replies: 6
    Last Post: 13 Jan 2011, 12:36 AM
  2. index.php in root not loading
    By cobrakai20 in forum Installing on a Linux/Unix Server
    Replies: 2
    Last Post: 27 Mar 2009, 09:44 PM
  3. Any way to determine the address path that was called?
    By busyMom in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 2 Jul 2008, 09:56 PM
  4. Moving index.php to root
    By Sc0tt in forum Basic Configuration
    Replies: 3
    Last Post: 24 May 2006, 11:46 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR