Welcome Guest, Not a member yet? Register   Sign In
anchorlinks not working on live site
#1

[eluser]learning_php[/eluser]
Hi,

I have put my site live but none of the links seem to be working? and i cannot navigate away from the home page?

I link to other pages like so:
Code:
<li>&lt;?= anchor('info','Information');?&gt;</li>
any suggestions?
#2

[eluser]Dam1an[/eluser]
Have you changed the base_url in your config file?
Whats the link it generates? (view source or what appearce in the status bar when you hover over the link)
#3

[eluser]learning_php[/eluser]
I changed the base url to
Code:
$config['base_url']    = 'http://www.wesayido.co.uk/';
The page souce code is
Code:
<li><a href="http://www.wesayido.co.uk/info">Information</a></li>
and when i hover over
Code:
http://www.wesayido.co.uk/info
#4

[eluser]Dam1an[/eluser]
Hmm... Seeing as the links are rendered correctly, and assuming they're clickable and the page reloads, I'd be tempted to say its something with you .htaccess file perhaps?
Maybe try renaming that (so it doesn't execute) and try a URL (including the index.php)
#5

[eluser]TheFuzzy0ne[/eluser]
Try changing uri_protocol in config.php to REQUEST_URI or QUERY_STRING.

If that doesn't work, please post you're htaccess file and any routes you might have.
#6

[eluser]learning_php[/eluser]
when i change it to a REQUEST_URI i get a 404 error?

here is my .htaccess
Code:
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteBase /http://www.wesayido.co.uk/
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ /index.php/$1 [QSA,NC,L]
</IfModule>

<IfModule !mod_rewrite.c>
  # If we don’t have mod_rewrite installed, all 404’s
  # can be sent to index.php, and everything works as normal.

  ErrorDocument 404 /index.php
</IfModule>

and my routes
Code:
$route['default_controller'] = "homepage";
$route[''] = "homepage";
$route['info'] = "www.wesayido.co.uk/Homepage/info";
$route['Gifts'] = "Homepage/gifts";
$route['gallery'] = "gallery/gallery";
$route['gallery'] = "gallery/index";
$route['register'] = "homepage/register";
$route['Church'] = "direction/direction";
$route['JockeyClub'] = "direction1/direction1";
$route['images'] = "dashboard";
#7

[eluser]rogierb[/eluser]
why use RewriteBase /http://www.wesayido.co.uk/?
RewriteBase / should be enough since you want to route to the root
#8

[eluser]learning_php[/eluser]
i have changed that line now this one works
Code:
$route['gallery'] = "gallery/index";
but i get 404 errors on the rest?
#9

[eluser]learning_php[/eluser]
hi,

just reuploaded the routes file to the server and all seems to be working.

Thanks for all your help
#10

[eluser]CroNiX[/eluser]
I had this problem as well. I found the problem was in the htaccess and using your line:
RewriteRule ^(.*)$ /index.php/$1 [QSA,NC,L]

I had to change mine to:
RewriteRule ^(.*)$ /index.php?/$1 [QSA,NC,L]
Adding the (?) after index.php

Not sure why....but it fixed it and maybe it will work for you too.




Theme © iAndrew 2016 - Forum software by © MyBB