Welcome Guest, Not a member yet? Register   Sign In
remove Index.php Not working in localhost
#1

[eluser]tj[/eluser]
Hai guys I do know that you guys hate to see this topic.I tried to search from old post but didnt find any

So whats my pblm is

in localhost i tried to remove index.php but its not working
BUT it works fine in server

In my config file

Code:
$config['base_url']    = "http://localhost/itech/projectmanagement/";

$config['index_page'] = "";

My .htaccess

Code:
RewriteEngine On
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

can any one help

i am using Apache 2.0 in ubuntu .
tnx in advance
#2

[eluser]rogierb[/eluser]
RewriteBase /itech/

If you install in a subdir of root, you need to rewrite the base / to the subdir /subdir/
#3

[eluser]charlie spider[/eluser]
also depends on where your index.php file is.
your htaccess path has to lead to your index.php.

rewrite base doesn't work for me, but

Code:
RewriteRule ^(.*)$ dir_name/index.php?/$1 [NC,L,QSA]

does work.


and depending on your server you may also have to add a ? after the .php

so try both:

Code:
RewriteRule ^(.*)$ itech/projectmanagement/index.php/$1 [NC,L,QSA]

and

Code:
RewriteRule ^(.*)$ itech/projectmanagement/index.php?/$1 [NC,L,QSA]

if rogierb's solution doesn't work
#4

[eluser]tj[/eluser]
sorry guys still not working

Code:
RewriteEngine On
RewriteBase /itech/projectmanagement
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]


Code:
RewriteEngine On
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ itech/projectmanagement/index.php/$1 [NC,L,QSA]  
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

AND ? also

is there any pbm with my htaccess
#5

[eluser]rogierb[/eluser]
RewriteBase /itech/projectmanagement/

Dont forget the slash.

Try this:
Code:
RewriteEngine On
RewriteBase /itech/projectmanagement/
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [NC,L,QSA]  
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
#6

[eluser]tj[/eluser]
Still not working
#7

[eluser]tomcode[/eluser]
Check whether Your .htaccess file is used, (type in an error and see whether You get an 500 server error)
#8

[eluser]charlie spider[/eluser]
hee hee... ya try tomcode's idea first.

nothing worse then trying to troubleshoot something when it simply isn't turned on.

if it is running, then here's a couple of other htaccess options for ya:

option 1
Code:
Options -Indexes
Options +FollowSymLinks
Options -MultiViews
DirectoryIndex index.php

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteBase /itech/projectmanagement/

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

  #Uncomment one of the following rewrite rules.
  #Some servers require the ? after index.php, some don't

  #RewriteRule ^(.*)$ index.php?/$1 [NC,L,QSA]
  #RewriteRule ^(.*)$ index.php/$1 [NC,L,QSA]

</IfModule>

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


option 2
Code:
Options -Indexes
Options +FollowSymLinks
Options -MultiViews
DirectoryIndex index.php

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteBase /

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

  #Uncomment one of the following rewrite rules.
  #Some servers require the ? after index.php, some don't

  #RewriteRule ^(.*)$ itech/projectmanagement/index.php?/$1 [NC,L,QSA]
  #RewriteRule ^(.*)$ itech/projectmanagement/index.php/$1 [NC,L,QSA]

</IfModule>

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

the above are snippets from Daniel Moore's Ultimate htaccess file. Search for it if you want some other cool htaccess tricks
#9

[eluser]tj[/eluser]
you are write tomcode my .htaccess is not using.i didnt get a 500 server error. how can i fix this

am using Apache 2.0 in ubuntu 9.04.
#10

[eluser]tomcode[/eluser]
On my Mac I change the file http.conf, I uncomment / add the line
Code:
LoadModule rewrite_module modules/mod_rewrite.so
Then You have to restart apache.

On Your machine You might need another line, but usually it's documented in the file itself, search the file for 'rewrite'.




Theme © iAndrew 2016 - Forum software by © MyBB