Welcome Guest, Not a member yet? Register   Sign In
.htaccess weird behavior, only homePage display
#1

[eluser]DocFunky![/eluser]
Hi,

I followed the official documentation to use a rewrite URL, but I got some weird behavior.

I can access to the main page, but when I try to access any of the other methods or class, I get redirected to wamp homepage, do you know why ? I did exactly what it is said in the wiki, and my . htaccess file is exactly the same.


Thank you

EDIT: Maybe I made an error in here : <Directory "/some/absolute/path/htdocs"> My path could be wrong. What would be the correct path to my www/codeigniter project ? What about other project in my www directory ? do they need an .htaccess too ?
#2

[eluser]skunkbad[/eluser]
[quote author="DocFunky!" date="1342300141"]Hi,

I followed the official documentation to use a rewrite URL, but I got some weird behavior.

I can access to the main page, but when I try to access any of the other methods or class, I get redirected to wamp homepage, do you know why ? I did exactly what it is said in the wiki, and my . htaccess file is exactly the same.


Thank you

EDIT: Maybe I made an error in here : <Directory "/some/absolute/path/htdocs"> My path could be wrong. What would be the correct path to my www/codeigniter project ? What about other project in my www directory ? do they need an .htaccess too ?[/quote]

Are you sure that your base URL and protocol in config/config are set correctly? Also, in wamp I believe you need to use a special RewriteBase in your .htaccess.
#3

[eluser]DocFunky![/eluser]
Well my base is :
$config['base_url'] = '';
and URI Protocol is :
$config['uri_protocol'] = 'QUERY_STRING';

The index is set on '' too.

Should I configure the base_url differently ?

Thanks !
#4

[eluser]InsiteFX[/eluser]
Try
Code:
$config['uri_protocol'] = 'REQUEST_URI';

Also it would help to see your .htaccess file.
#5

[eluser]DocFunky![/eluser]
Hello, my .htaccess file is exactly the same than the one given in the wiki, which means :

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>

And here is my httpd.conf

Code:
<Directory />
Options Indexes Includes FollowSymLinks MultiViews
AllowOverride AuthConfig FileInfo
Order allow,deny
Allow from all
</Directory>

I tried
Code:
$config['uri_protocol'] = 'REQUEST_URI';
but nothing changed

Thank you !
#6

[eluser]skunkbad[/eluser]
Try a different RewriteBase
#7

[eluser]DocFunky![/eluser]
Okay, I rewrote the first lines and it works fine now, I just replace the 3 first lines by :

Code:
<IfModule mod_rewrite.c>
    SetEnv MAGIC_QUOTES 0
SetEnv PHP_VER 5
Options +FollowSymlinks -MultiViews
RewriteEngine On
DirectoryIndex index.php




Theme © iAndrew 2016 - Forum software by © MyBB