Welcome Guest, Not a member yet? Register   Sign In
my .htaccess file is not working
#1

[eluser]Sumon[/eluser]
hi all,

i develope my site using CodeIgniter and trying to hide url(index.php). Server guys replied me : "Mod_rewrite is enabled for your account". As such i write
a .htaccess file with the following code:

Options +FollowSymLinks
DirectoryIndex index.php
RewriteEngine On
RewriteRule ^.htaccess$ - [F]
RewriteRule ^favicon.ico - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

Now here is the URL i have tried to browse But not working.

www.mysite.com/home
instead of
www.mysite.com/index.php/home

[ The page display: No input file specified. ]

Is any change needed in config.php file? Please help me to resolve my problem.
#2

[eluser]zzet[/eluser]
1. question: Are you using PHP4 or PHP5?
2. question: Is your PHP running as a CGI or as an apache-module?

You can try these things:
RewriteRule ^(.*)$ /index.php/$1 [R] instead of ... [L]
or (if you have access to your php.ini and your PHP is running as CGI) you can add this line to your php.ini:
cgi.fix_pathinfo = 0
#3

[eluser]Sumon[/eluser]
Thanks, it's working fine. it's automatically add index.php. However, if i can hide index.php then i shall be more happy. Moreover, here is your answers:
1. question: Are you using PHP4 or PHP5?
Ans: PHP 5.2
2. question: Is your PHP running as a CGI or as an apache-module?
Ans: I am not sure. How can i be sure about it? However, i found a folder in root (through FTP) named CGI.

Sorry to say i don't have access of my php.ini.
#4

[eluser]zzet[/eluser]
Ok, try
Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule ^(.*)$ /index.php?/$1 [L] <-- do not forget the ? after index.php!
</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.

    ErrorDocument 404 /index.php
</IfModule>

in config.php set
Code:
$config['index_page'] = "";
$config['uri_protocol']    = "AUTO";

With this htaccess index.php-hiding works for me with PHP4 and PHP5 running PHP as a CGI
#5

[eluser]Sumon[/eluser]
oaow !!!!! only a ? mark makes me tensed... Anyway, thank you very very very much. Now my site works fine with http://shopno-dinga.com/home this url.

thanks.
#6

[eluser]bluepicaso[/eluser]
nothing helping me at all
my url follows only this condition below

<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.

ErrorDocument 404 /index.php
</IfModule>
i have changed httpd.conf
#LoadModule rewrite_module modules/mod_rewrite.so

to

LoadModule rewrite_module modules/mod_rewrite.so

My url redirects to the root page

Help me m stuck from last 4 hours Sad




Theme © iAndrew 2016 - Forum software by © MyBB