Welcome Guest, Not a member yet? Register   Sign In
extra variables appear in url after leaving home page
#1

[eluser]paulcj2[/eluser]
In my test site:
www.clickbasicsdemo.com/index.php
when one clicks on a link in the top navigation from the home page (for example the link "page") the link works fine. However, after arriving on "page" the urls contain extra variable "/page/clickbasicsdemo/", which is incorrect and brings up a 404 page not found error. Here's what I have done to configure the urls:
1) in the .htaccess file
RewriteEngine on
RewriteCond $1 !^(index\.php|css|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

2) in config/config.php
$config['base_url'] = BASE_URL;

3) in config/constants.php
define('BASE_URL', 'http://clickbasicsdemo.com/');
define('SITE_ADDRESS', 'clickbasicsdemo');

4) in views/header.php
the top navigation link for "page" is <li><a href="page/clickbasicsdemo/444">page</a> </li>

What's my next troubleshooting step?
#2

[eluser]paulcj2[/eluser]
Aha! I just created a new page: "product categories"
http://www.clickbasicsdemo.com/cats_prod
The url problem does not show up from the "product categories" page, so it must be the "Page" controller or view where the problem is.

I considered that naming a controller and view "Page" could be the problem. However, that name does not seem to be reserved by CodeIgniter:
http://ellislab.com/codeigniter/user-gui...names.html
#3

[eluser]paulcj2[/eluser]
The problem may lie in my config/routes.php file.
Code:
$route['page/([a-z]+)/(:num)'] = "page/index/$1/$2";




Theme © iAndrew 2016 - Forum software by © MyBB