• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help with .htaccess Mod-rewrite for my CI-based web application on a live server

#1
[eluser]Unknown[/eluser]
Hi Guys,

I am trying to host my CI-based web application on a live server.
Site A currently runs on the web hosting plan, which is the main web hosting account. Site A uses a .htaccess file as shown below. Site A is in directory path /www/ on the linux server.
Code:
# Make all PHP code look like HTML
AddType application/x-httpd-php  .  .action .html  .catalogue


RewriteEngine on

RewriteRule ServletController.action$ index.php

RewriteRule my/loading.action$ my/loading.php

RewriteRule my/CustomerLogin.action$ my/ClientLogin.php

RewriteRule about_us.html$ about.php

RewriteRule contact.html$ contact.php

RewriteRule sales.html$ sales.php

RewriteRule terms.html$ terms.php

RewriteRule returns.html$ returns.php

RewriteRule testimonials.html$ testimonials.php

RewriteRule email.html$ email.php

RewriteRule sendmail.action$ sendemail.php

RewriteRule _search.action$ _search.php

RewriteRule createaccount.action$ createaccount.php

RewriteRule newcustomer.action$ newcustomer.php

RewriteRule faq.html$ faq.php

RewriteRule WCS/PRODUCTS-SHOWROOM-VIEW-(.*)\-SELECT-(.*)\.action$ WCS/products.php?VIEW=$1&SELECT;=$2

RewriteRule WCS/display.action$ WCS/display.php

RewriteRule WCS/add2cart.action$ WCS/add2cart.php

RewriteRule WCS/remove.action$ WCS/remove.php

RewriteRule WCS/displaycart.action$ WCS/displaycart.php

RewriteRule WCS/viewcart.action$ WCS/viewcart.php

RewriteRule WCS/updatecart.action$ WCS/update.php

RewriteRule WCS/productx.action$ WCS/productx.php

RewriteRule webstore/shoppingcart.action$ webstore/shoppingcart.php

RewriteRule webstore/deliveryoptions.action$ webstore/delivery.php

RewriteRule webstore/mydeliveryoptions.action$ webstore/mydelivery.php

RewriteRule webstore/checkout.action$ webstore/checkout.php

RewriteRule webstore/confirmation.action$ webstore/confirm.php

RewriteRule webstore/checkouterror.action$ webstore/checkouterror.php

RewriteRule webstore/paymenterror.action$ webstore/paymenterror.php

RewriteRule my/mySSAccount.action$ my/customerhome.php

RewriteRule my/mySSAccount2.action$ my/customerhome2.php

RewriteRule my/profile.action$ my/profile.php

RewriteRule my/paymenthistory.action$ my/payment.php

RewriteRule my/logout.action$ my/logout.php

RewriteRule my/signin.action$ my/signin.php

RewriteRule my/PasswordReset.action$ my/resetpassword.php

RewriteRule my/contact.action$ my/contact.php

RewriteRule my/sendrequest.action$ my/send.php

RewriteRule my/deletetranx.action$ my/delete.php

RewriteRule my/sendpassword.action$ my/email_password.php

RewriteEngine On
RewriteRule ^orderdirect/([^/]*)/([^/]*)$ /id.php?orderdirect=$1&orderdirect;=$2 [L]

RewriteRule ^orderdirect/24/7/$ /id.php?orderdirect=24&orderdirect=7/


Site B is a CI based site and it is was slated to be implemented as a registered domain and then configured as a Add-on domain to the current hosting plan. It has been activated and the directory where the files are meant to reside is /www/oakland.co.uk/.

the .htaccess file for Site B is as shown here:
Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /www/oakland.co.uk/

    #Removes access to the system folder by users.
    #Additionally this will allow you to create a System.php controller,
    #previously this would not have been possible.
    #'system' can be replaced if you have renamed your system folder.
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]
    
    #When your application folder isn't in the system folder
    #This snippet prevents user access to the application folder
    #Submitted by: Fabdrol
    #Rename 'application' to your applications folder name.
    RewriteCond %{REQUEST_URI} ^application.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    #Checks to see if the user is attempting to access a valid file,
    #such as an image or css document, if this isn't true it sends the
    #request to index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
  
</IfModule>


Currently I have uploaded the files accordingly and have adjusted the config and index.php file settings to align with the linux server settings for the live site.

When I run the site online I keep getting error tagged -"500 server misconfiguration". I'm not sure if its because I use 2 separate .htaccess files for the 2 different websites in their respective root directories

Can anyone help with how I can fix this. I am not so sound with .htaccess configuration online.


Thanks


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.