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 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jan 2013
    Location
    Australia
    Posts
    118
    Thanks
    22
    Thanked 0 Times in 0 Posts

    HTACCESS Question Stuck

    Hi I have this htaccess code that I use to remove my index.php but will not remove it on my sub folders in my server.

    http://www.carrarawebsitesolutions.c...x.php/hmvctest

    below is the current htaccess what do I need todo also so can remove the index.php from sub sub folder.

    Code:
    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /
    
        #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>
    
    <IfModule !mod_rewrite.c>
        # If we don't have mod_rewrite installed, all 404's
        # can be sent to index.php, and everything works as normal.
        # Submitted by: ElliotHaughin
    
        ErrorDocument 404 /index.php
    </IfModule>
    Founder Of Riwaka Website Designs
    http://www.riwakawebsitedesigns.com

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Nothing to do with PHP, moving to apache configurations.
    Code:
        RewriteRule ^(.*)$ index.php?/$1 [L]
    Replace with:
    Code:
        RewriteRule ^(.*)$ /index.php?/$1 [L]
    Subtle, yes. If its cascaded, the difference is between the index.php located directly within a subdirectory (which would then throw a 404) versus the one in the site root.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #3
    Regular Coder
    Join Date
    Jan 2013
    Location
    Australia
    Posts
    118
    Thanks
    22
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Fou-Lu View Post
    Nothing to do with PHP, moving to apache configurations.
    Code:
        RewriteRule ^(.*)$ index.php?/$1 [L]
    Replace with:
    Code:
        RewriteRule ^(.*)$ /index.php?/$1 [L]
    Subtle, yes. If its cascaded, the difference is between the index.php located directly within a subdirectory (which would then throw a 404) versus the one in the site root.
    Hi did the changes no luck. I put htaccess on main directory and nothing also tried my sub sub folder.
    Founder Of Riwaka Website Designs
    http://www.riwakawebsitedesigns.com

  • #4
    Regular Coder
    Join Date
    Jan 2013
    Location
    Australia
    Posts
    118
    Thanks
    22
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Fou-Lu View Post
    Nothing to do with PHP, moving to apache configurations.
    Code:
        RewriteRule ^(.*)$ index.php?/$1 [L]
    Replace with:
    Code:
        RewriteRule ^(.*)$ /index.php?/$1 [L]
    Subtle, yes. If its cascaded, the difference is between the index.php located directly within a subdirectory (which would then throw a 404) versus the one in the site root.
    I found out away that I got it to work using cPanel sub domains thanks for help.
    Founder Of Riwaka Website Designs
    http://www.riwakawebsitedesigns.com


  •  

    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
    •