Welcome Guest, Not a member yet? Register   Sign In
after removing index.php from url page is not working
#1

[eluser]Was[/eluser]
Hello,

i have url something www.mysitename.com/index.php/contact-us. but i need www.mysitename.com/contact-us like this.but when i m removing index.php from my url page is giving error message i have changed $config['index_page'] = 'index.php'; to $config['index_page'] = ''; in config.php and added the following code

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]


in .htaccess but its giving me an error message.so what else i m measing?

Thanx
Was
#2

[eluser]InsiteFX[/eluser]
Try this:
Code:
php_value default_charset utf-8

Options FollowSymLinks
Options -Indexes
DirectoryIndex index.php

RewriteEngine On

#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 $1 !^(index\.php|assets|css|js|images|img|robots\.txt|favicon\.ico)

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
#3

[eluser]Was[/eluser]
Hello Friend, i have added the

RewriteEngine On

RewriteCond $1 !^(index\.php|assets|css|js|images|img|robots\.txt|favicon\.ico)

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

code in my .htaccess file but getting the The page cannot be found error i m wondering about

php_value default_charset utf-8

Options FollowSymLinks
Options -Indexes
DirectoryIndex index.php

this starting line which is given by u to me so where should can i put this ? or should i missing anything else in my code?
thanx
Was
#4

[eluser]InsiteFX[/eluser]
Page not found is your controller not finding the page check your routes along with your base_url

You may also need to change this trying different ones
Code:
/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string.  The default setting of 'AUTO' works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'AUTO'   Default - auto detects
| 'PATH_INFO'  Uses the PATH_INFO
| 'QUERY_STRING' Uses the QUERY_STRING
| 'REQUEST_URI'  Uses the REQUEST_URI
| 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO
|
*/
$config['uri_protocol'] = 'REQUEST_URI';
#5

[eluser]Was[/eluser]
Hello Friend,

i have tried with different uri_protocol settings in config.php but getting the same message and its a my browsers 404 page not found error message and not of codeigniters 404 page i m getting

The page cannot be found

The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.
Please try the following:

Make sure that the Web site address displayed in the address bar of your browser is spelled and formatted correctly.
If you reached this page by clicking a link, contact the Web site administrator to alert them that the link is incorrectly formatted.
Click the Back button to try another link.
HTTP Error 404 - File or directory not found.
Internet Information Services (IIS)

Technical Information (for support personnel)

Go to Microsoft Product Support Services and perform a title search for the words HTTP and 404.
Open IIS Help, which is accessible in IIS Manager (inetmgr), and search for topics titled Web Site Setup, Common Administrative Tasks, and About Custom Error Messages.


Thanx
Was
#6

[eluser]Aken[/eluser]
You're using a Windows server, which treats .htaccess files a LOT differently. I would do some searching here and/or on Google for removing index.php on Windows servers.
#7

[eluser]Was[/eluser]
Hello,

its not an windows server its a linux server.

Thanx
Was
#8

[eluser]Aken[/eluser]
Then why does your error text mention Microsoft and IIS repeatedly?
#9

[eluser]Was[/eluser]
Its a message given by my google chrome which i m using.
#10

[eluser]Aken[/eluser]
Error pages are generated by the server, not the web browser...




Theme © iAndrew 2016 - Forum software by © MyBB