Announcement

Collapse
No announcement yet.

Use .htaccess or index.php

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Use .htaccess or index.php

    I am trying to make sure that my DNS entry and hosting configurations are correct. My host (hostasaurus) says that I have two options to make sure that the first page someone sees when they enter the store url at www.mysite.com is to use either a .htaccess file or index.php file.

    The instructions say that the .htaccess method is "less preferable" than the index.php file.

    To implement the index.php file, they say the file needs to contain:
    <?php
    header("HTTP/1.1 301 Moved Permanently");
    header ( "Location: /Merchant2/merchant.mvc" );
    ?>

    My question is that since this is a "redirect", will search engines cough on this? I thought that they hated these kind of things.

    Is .htaccess the preferred way of doing this?

    Thanks

    Fredric Gluck
    MarketThink, LLC
    ------------------------------
    Fredric Gluck
    MarketThink, LLC
    On-line and E-commerce Marketing Solutions
    www.MarketThinkOnline.com

    #2
    The downside to the .htaccess method is that the .htaccess file must be parsed by the server for statements on every request, including image requests and anything else. If you would not otherwise have a .htaccess file, the PHP method is less overhead.
    David Hubbard
    CIO
    Miva
    [email protected]
    http://www.miva.com

    Comment


      #3
      That's interesting to know, .htaccess file get parsed for each server request.

      I am hav been using .htaccess for makiny my store SEO friendly. I hav minimal links having merchant.mvc? etc.

      Though, i hav observerd any performance drop, may be if i run compare tests b/w old way and new way, i might see.

      though using .htaccess was very easy way. In couple of hrs, all my links were seo name friendly.
      ...Ashish
      Webmaster - http://www.FragranceOcean.com

      Comment


        #4
        The processing requirements for parsing the file are negligible so it won't normally result in a visible difference except on a very high traffic site.
        David Hubbard
        CIO
        Miva
        [email protected]
        http://www.miva.com

        Comment


          #5
          OK... I can accept that the host will plan for this overhead and take it into account.

          Which alternative is most suitable and most acceptable for search engines?
          ------------------------------
          Fredric Gluck
          MarketThink, LLC
          On-line and E-commerce Marketing Solutions
          www.MarketThinkOnline.com

          Comment


            #6
            I personally think an optimized home page containing lots of relevant content and well-constructed html is much better than directing the site's homepage to the Merchant storefront.
            David Hubbard
            CIO
            Miva
            [email protected]
            http://www.miva.com

            Comment


              #7
              Personally I'd tell that parsing a PHP file will cause much more overhead than parsing an .htaccess file, especially because the content of the .htaccess file (better told the parsed status) is stored in the operating memory and not being re-parsed unless the file changes. At an external script, the engine has to be accessed, and I'd expect much bigger impact. However, if you do not trust my opinion, you can always set the DirectoryIndex directive in the global httpd.conf file - that is being parsed only once at the boot time. In any case, both methods are completely negligible in comparison to the overhead of a Miva Empresa driven page. For that reason, at a website with huge traffic caused mostly by visitors who do not browse the store, using a plain HTML index page may be the best solution - visitors who land on it by mistake will leave without triggering any Miva or PHP driven page and will not cause any considerable slowdown of the server.
              Ivo Truxa . @ . t r u X o f t

              Comment


                #8
                Originally posted by fgluck
                OK... I can accept that the host will plan for this overhead and take it into account.

                Which alternative is most suitable and most acceptable for search engines?
                Use the .htaccess method

                Jason
                Jason Henderson - JMH Web Services
                Miva Merchant Marketing Mastermind Group

                SEO & Marketing for Miva Merchant
                Miva Merchant Modules Comparison Directory
                Miva Merchant Tutorials
                Working with Miva Merchant since 1999 including search engine optimization and marketing specifically for Miva Merchant store owners.

                Comment


                  #9
                  Works like a champ .. Thanks

                  Thanks for the input here....

                  I created a .htaccess file with the following in it:

                  DirectoryIndex index.html /miva/merchant.mvc

                  and put it in my home directory.

                  I renamed index.html (a default file provided by the host) to index_orig.html (just for safety's sake) and it works like a champ.

                  One tip -- if you use an FTP program to move the file from your local PC to the UNIX host, remember that some programs do not list files that begin with ".". so don't worry if you don't see the file.

                  Hostasaurus -- you might want to update your FAQ document so that it reflects M5 directory structure.

                  Thanks again for the forum help!
                  ------------------------------
                  Fredric Gluck
                  MarketThink, LLC
                  On-line and E-commerce Marketing Solutions
                  www.MarketThinkOnline.com

                  Comment


                    #10
                    htaccess

                    Is there a good tutor page out there, that shows how to create a htaccess file?

                    Comment


                      #11
                      Tutorial on .htaccess

                      .htaccess seems to be one of those magic files that can do just about anything. Kind of like a swiss army knife. I believe that it is one of the key components used in rewriting URLS so that they are search friendly.

                      I Googled ".htaccess rewrite engine" and this seems to be a well written reference page

                      http://corz.org/serv/tricks/htaccess2.php

                      Looks like alot of mind-bending stuff. Great reading!
                      ------------------------------
                      Fredric Gluck
                      MarketThink, LLC
                      On-line and E-commerce Marketing Solutions
                      www.MarketThinkOnline.com

                      Comment


                        #12
                        Just an alternative approach to this:
                        Code:
                        #############
                        # Rewrite web root to /SUBDIR
                        #############
                        RewriteEngine On
                        RewriteRule ^$ /SUBDIR [R=301,L]
                        Is the code I use.

                        Comment


                          #13
                          Originally posted by Brandon MUS
                          Just an alternative approach to this:
                          Code:
                          #############
                          # Rewrite web root to /SUBDIR
                          #############
                          RewriteEngine On
                          RewriteRule ^$ /SUBDIR [R=301,L]
                          Is the code I use.
                          If I have this correct this file you put in your root folder and then anything directed to your root folder is sent to your subfolder?

                          Does this get rid of the MM5 in the url to Miva, which is what I am after? Does anyone else have a htaccess file they would share to shorten the URL to exclude the MM5 directory in the URL.

                          After reading many pages about rewrite, I still don't get it.

                          Comment


                            #14
                            Are you trying to "hide" the Miva URL? Or just redirect to it?

                            The code I posted will only redirect to it. There are other rewrite rules you can use to hide it completely, but you will have to do a lot of work inside of MM (changing the linking structure) to continue to surpress the /Merchant directory beyond the first link, if that's what you are after.

                            Brandon

                            Comment


                              #15
                              Hi I'm trying to change the url with mod_rewrite, I just think having a site store that points to www.whatever.com/mm5/ looks bad, and people will not remember the mm5, but would be more likely to remember www.whaterver.com/productsname.

                              And on a more practical level I use some php pages, that work on a database and dicovered that because I use a shared ssl license on my sites, when you link to miva without using the MIVA variables in the url people get a nasty looking message about the domain not matching the certificate.


                              I have redirected with the sever, would rather people and search engines where unaware of the redirect.

                              Comment

                              Working...
                              X