Welcome Guest, Not a member yet? Register   Sign In
.htaccess and rewrite not working!
#1

[eluser]learning_php[/eluser]
I have been trying to get these links to work for a while and i am not having any luck. I have edited the httpd.conf file and have the following code. When i click he links i get a apache 404 error and i am complety stuck.

.htaccess
Code:
  RewriteEngine on
  RewriteBase /mysite/
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php/$1 [QSA,NC,L]

controller
Code:
<?php

class Homepage extends Controller {

    function Homepage()
    {
        parent::Controller();    
    }
    
    function index()
    {
        $this->load->view('index.php');
    }
    
    
    function About()
    {
        $this->load->view('about.php');
    }
    
}

/* End of file homepage.php */
/* Location: ./system/application/controllers/homepage.php */

view[code]
    <body>
    
    <div id = "container">
  
        <div id = "header">
            <div id= "nav">
                <div id = "tab">
                    <div id = "navtext"><p>&lt;?php echo anchor('/index', 'Home');?&gt;</p></div>
                </div>
                <div id = "tab">
                      <div id = "navtext"><p>&lt;?php echo anchor('/about', 'About');?&gt;</p></div>
                  </div>
                <div id = "tab">
                      <div id = "navtext">Work</div>
                  </div>
                  <div id = "tab">
                      <div id = "navtext">Contact</div>
                  </div>
                  <div id = "tab">
                      <div id = "navtext">Blog</div>
                  </div>
            </div>
        </div>
        
        <div id = "content">
            <div id ="textbox">
                <div id ="blogtextbox"></div>
            </div>
            <div id = "sidetextbox"></div>
        </div>
    </div>

    
    &lt;/body&gt;
[/code]
#2

[eluser]danmontgomery[/eluser]
ensure mod_rewrite is enabled in apache
#3

[eluser]learning_php[/eluser]
When i installed mamp it was already loaded and i changed the Allowoveride to all. but i don't think the .htaccess file is working?

httpd.conf
Code:
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so

# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
    AllowOverride All




Theme © iAndrew 2016 - Forum software by © MyBB