Welcome Guest, Not a member yet? Register   Sign In
.htaccess and rewrite on mac
#11

[eluser]learning_php[/eluser]
I am trying to update the httpd.conf file but it wont let me save it so i tried the terminal “sudo pico /etc/apache2/httpd.conf” and edited that way but it saved a conf.save file instead of updating the original?
#12

[eluser]learning_php[/eluser]
Hi have now set the Allowoveride to all but it still does not seem to be working? this is what i have got.

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;

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

httpd.conf
Code:
# 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
#13

[eluser]brett_mekanik[/eluser]
Hi learning_php:

Did you get this solved? I'm experiencing the same problem.
Thanks
#14

[eluser]learning_php[/eluser]
Hi,

Afraid not. Please let me know if you get anyware with this problem as I think I have tried almost everything possible.

Thanks
#15

[eluser]brett_mekanik[/eluser]
Got it! I found the information I needed on these 2 pages:

http://ellislab.com/forums/viewthread/79825/#401151
http://www.danielwmoore.com/articles/rem...deigniter/

The following htaccess file will rewrite all urls except those beginning with the exceptions in the first RewriteCond line:

# ================= #
DirectoryIndex index.php

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]
</IfModule>

<IfModule !mod_rewrite.c>
ErrorDocument 404 index.php
</IfModule>
# ================= #

In case my setup differs from yours, I'm using MAMP with the htdocs folder set up like this so there's a single installation of CodeIgniter.

<folder name="htdocs">

<folder name="ci">

<folder name="CodeIgniter_1.7.2">
</folder>

<folder name="app_1_application">
</folder>
<folder name="app_1_webroot">
.htaccess
index.php
</folder>

<folder name="app_2_application">
</folder>
<folder name="app_2_webroot">
</folder>
<folder name="app_3_application">
</folder>
<folder name="app_3_webroot">
</folder>

</folder>

<folder name="non_ci_site_1">
</folder>
<folder name="non_ci_site_2">
</folder>

</folder>

I hope this helps you.




Theme © iAndrew 2016 - Forum software by © MyBB