Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Dec 2008
    Location
    Ohio, USA
    Posts
    40
    Thanks
    7
    Thanked 0 Times in 0 Posts

    .htaccess vs .bk file re: mod_rewrite

    Hi all,

    It's been a while since I've been here but this has always been the place I've turned to for coding questions because of the depth of expertise among members.

    I have been hosting several websites with one hosting plan by using a mod_rewrite .htaccess file in the root directory of my server space. I got the code from a member here and it worked great with my former web hosting service who used
    Apache servers. I've recently switched to a hosting provider that uses Litespeed servers (not sure what the difference is). When the techs migrated all my files, databases and info from the old servers to their servers, the mod_rewrite .htaccess file continued to work fine and all my sites loaded. I just recently added another website into my root directory and, after pointing the new domain to my current servers and a couple hours propagation time, I was getting a 404 File Not Found error page with this new site. The other sites continued to load just fine. The tech took a look at things and what he did to resolve the issue was to make the .htaccess file a .bk file. The new site is loading now but it is very curious to me. I'm wondering if .htaccess files are specifically for Apache servers? If so, why were my other sites loading with the .htaccess file and not the new one? The PHP code remained the same as before, the only thing that changed in the mod_rewrite file was the file extension, from .htaccess to .htaccess.bk . The other difference between the new site and the other sites is that the new site directory only has a basic index.html file in it that shows an 'under construction page'. The other sites contain Wordpress and have the required .htaccess file in their root directories. Below is the PHP code in the mod_rewrite file which resides in the root directory of my server space, and below that is the PHP code contained in the root directories of the Wordpress sites. I hope this isn't all too confusing. Lol.

    Does anyone have input into this situation so I'll know for future reference?

    Thanks so much.

    PHP code contained in the .htaccess.bk file in the root directory of my server space
    PHP Code:
    RewriteEngine On
    Options 
    +FollowSymlinks
    RewriteBase 
    /
    RewriteCond %{HTTP_HOSTlaughingclubneo.com$
    RewriteCond %{REQUEST_URI} !laughingclubneo.com/
    RewriteRule ^(.*)$ laughingclubneo.com/$1

    RewriteEngine On
    Options 
    +FollowSymlinks
    RewriteBase 
    /
    RewriteCond %{HTTP_HOSTshawnjomalley.com$
    RewriteCond %{REQUEST_URI} !shawnjomalley.com/
    RewriteRule ^(.*)$ shawnjomalley.com/$1

    RewriteEngine On
    Options 
    +FollowSymlinks
    RewriteBase 
    /
    RewriteCond %{HTTP_HOSTmyvisualmenu.com$
    RewriteCond %{REQUEST_URI} !myvisualmenu.com/
    RewriteRule ^(.*)$ myvisualmenu.com/$1

    RewriteEngine On
    Options 
    +FollowSymlinks
    RewriteBase 
    /
    RewriteCond %{HTTP_HOSTjpalenhouseblog.com$
    RewriteCond %{REQUEST_URI} !jpalenhouseblog.com/
    RewriteRule ^(.*)$ jpalenhouseblog.com/$
    PHP code contained in the root directories of the Wordpress sites
    PHP Code:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase 
    /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond 
    %{REQUEST_FILENAME} !-d
    RewriteRule 
    . /index.php [L]
    </
    IfModule>
    # END WordPress 

  2. #2
    New Coder
    Join Date
    Dec 2008
    Location
    Ohio, USA
    Posts
    40
    Thanks
    7
    Thanked 0 Times in 0 Posts

    resolved

    Hi,

    This dilemma has been resolved. I didn't know how to mark my post as resolved so am putting a quick reply in.

    What was happening was, my previous hosting company had an antiquated control panel so I needed the mod_rewrite file in the root directory of my server to point requests to specified website folders. My new hosting service, MDD Hosting, has a fantastic control panel with the option of creating 'addon domains' which accomplishes the same thing as the .htaccess file mod_rewrite did with my old hosting service. I no longer need the mod_rewrite file.

    Thanks.

    Dennis


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •