Welcome Guest, Not a member yet? Register   Sign In
How to remove index.php from URL
#1

[eluser]ebrahimthex[/eluser]
How can i remove index.php in my LAMP Server.

This works: http://localhost/mysite.com/index.php/home
But this generates 404 errors: http://localhost/mysite.com/home

Code:
<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /var/www
<Directory />
  Options +FollowSymLinks
  AllowOverride None
</Directory>
<Directory /var/www/>
  Options Indexes +FollowSymLinks MultiViews
  AllowOverride None
  Order allow,deny
  allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
  AllowOverride None
  Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
  Order allow,deny
  Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

and this is my .htaccess in /var/www/russelhost/

Code:
RewriteEngine on
RewriteBase /russelhost/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
and I also Change from application/config/config.php
Code:
$config['index_page'] = “index.php” by $config['index_page'] = “”
$config['uri_protocol'] = “AUTO” by $config['uri_protocol'] = “REQUEST_URI”

Now What Can i do?
#2

[eluser]ebrahimthex[/eluser]
How can i remove index.php in Codeigniter URL? USE LAMP Server.

This works: http://localhost/mysite.com/index.php/home
But this generates 404 errors: http://localhost/mysite.com/home

Code:
<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /var/www
<Directory />
  Options +FollowSymLinks
  AllowOverride None
</Directory>
<Directory /var/www/>
  Options Indexes +FollowSymLinks MultiViews
  AllowOverride None
  Order allow,deny
  allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
  AllowOverride None
  Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
  Order allow,deny
  Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

and this is my .htaccess in /var/www/russelhost/

Code:
RewriteEngine on
RewriteBase /russelhost/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
and I also Change from application/config/config.php
Code:
$config['index_page'] = “index.php” by $config['index_page'] = “”
$config['uri_protocol'] = “AUTO” by $config['uri_protocol'] = “REQUEST_URI”

Now What Can i do?[/quote]
#3

[eluser]Unknown[/eluser]
Hey Guys my name is Mark.According to that topic well i think that if you want to remove index.php from URL then you should use that coding for that purpose:

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php\ HTTP/ RewriteRule ^(([^/]+/)*)index\.php$ http://www.%{HTTP_HOST}/ [R=301,NS,L]






Theme © iAndrew 2016 - Forum software by © MyBB