CodeIgniter Forums

Full Version: Return URI Segment
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2

El Forum


I have a site

When i click on Login button it goes to this link. When i serch the code i found this lines of code. where home, login are not directories.

$page_name = $this->uri->segment(2);
$controller_name = $this->uri->segment(1);

I didn't get this code.

Now i want to change the code file into link. But the inner pages are not found. It shows 404 error.

I don't know about uri how can i solve it....

can anyone help for this..............

Thanks in advance..

El Forum

Quote:Now i want to change the code file into link.

Du you mean you want to have the same functionality but instead of calling
"home/logIn" you want to have "demo/Baxobeat" in your URL?

El Forum

no i want to change the link as

El Forum

i mean i want to put the file into aapkapaper domain in demo folder as Baxobeat folder....

Previously it was on baxobeat domain.

El Forum

Did you move the whole application to the new destination?
If yes the code should work as before. Maybe you have to
edit the htaccess file (rewriteBase).

El Forum

yes i want to move the whole application to the new destination, but after moving when i click the login button it shows the 404 error, can u please say why is this??

Real link

after changing the application to new destination this is the link

Please check it..........

thank u...

El Forum

Did you edit the .htaccess file like suggested? Try to set
the rewriteBase according to the new location and see what

El Forum

i tried it but no changes has been occured......

there are many .htaccess files which one i change??

El Forum

It would be the .htaccess in your root directory (where your index.php is

There are different ways to set up a .htaccess file depending on the
server environment and what exactly you want to achieve.

An example .htaccess that works for my needs:
<IfModule mod_rewrite.c>

Options +FollowSymLinks

# Turn on the Rewrite Engine
RewriteEngine On

# modified allready for your url:
RewriteBase /demo/Baxobeat/

# If the file or directory exists, show it
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) - [PT,L]

# Blank queries get sent to the index
RewriteRule ^$ index.php [L]

# All other queries get sent to the index as index.php/whatever
RewriteRule ^(.*)$ index.php/$1 [L]


If that doesn work for you do some research about .htaccess files
and Codeigniter. There are many posts about that kind of issues.

A good start before doing te research would be reading about the

Hope that helps

El Forum

Thank u for the reply but, when i put the .htaccess file on root directory it show some errors i.e.:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

can you help for this error.........
Pages: 1 2