Welcome Guest, Not a member yet? Register   Sign In
Routing issue
#1

(This post was last modified: 04-29-2015, 07:33 AM by behnampmdg3.)

Hi;

I have made some small changes in route in order to show a URL in a slightly different way. It works fine locally but not on-line. What am I doing wrong?

This works fine:
Code:
http://localhost:8888/breakup_opt/get-ex-girlfreind-back/first-thing-to-do-before-getting-your-ex-back

This doesn't (shows 404)
Code:
http://mywebsite.com/get-ex-girlfreind-back/first-thing-to-do-before-getting-your-ex-back

Here is my route:
PHP Code:
$route['get-ex-girlfreind-back/(:any)'] = 'blog/index/$1'

Here is blog controller:
PHP Code:
class Blog extends CI_Controller {

 public function 
index($blog_link)
 {
 .... 

Thanks
Reply
#2

I can't find anything wrong in your route setting.
What's the value of $config['base_url'] in your config.php file?
Reply
#3

It could be a previous defined route messing it up. Do you have any other routes defined with 'get-ex-girlfreind-back' as the first segment? If so, show all of those routes, and in order they are defined.

BTW friend uses ie, not ei Smile
Reply
#4

(This post was last modified: 04-29-2015, 03:51 PM by behnampmdg3.)

(04-29-2015, 11:16 AM)CroNiX Wrote: It could be a previous defined route messing it up. Do you have any other routes defined with 'get-ex-girlfreind-back' as the first segment?



Not really. This is my route:
PHP Code:
$route['default_controller'] = 'opt';
$route['video/(:any)'] = 'video/index/$1';
$route['get-ex-girlfriend-back/(:any)'] = 'blog/index/$1';

$route['video_temp/(:any)'] = 'video_temp/index/$1';
$route['404_override'] = 'login';
$route['translate_uri_dashes'] = FALSE



(04-29-2015, 11:16 AM)CroNiX Wrote: BTW friend uses ie, not ei Smile
Thanks for that.
Reply
#5

If and only if you are using CI_3.0.0 then check the update logs because the routing has changed.

PHP Code:
// $route['get-ex-girlfreind-back/(:any)'] = 'blog/index/$1'; 
// try this instead
$route['get-ex-girlfreind-back/(.+)'] = 'blog/index/$1'

// off topic - spelling mistake
// try friend instead of freind 
// maybe that is why she left :-)
// 
Reply
#6

(This post was last modified: 04-29-2015, 08:31 PM by behnampmdg3.)

(04-29-2015, 07:39 PM)John_Betong Wrote: If and only if you are using CI_3.0.0 then check the update logs because the routing has changed.



PHP Code:
// $route['get-ex-girlfreind-back/(:any)'] = 'blog/index/$1'; 
// try this instead
$route['get-ex-girlfreind-back/(.+)'] = 'blog/index/$1'

// off topic - spelling mistake
// try friend instead of freind 
// maybe that is why she left :-)
// 
yeh I am on CI 3...But I didnt have issues with other files. For example this works fine:
PHP Code:
$route['video/(:any)'] = 'video/index/$1'

I tried it for that page it didn't work Sad
Reply
#7

(This post was last modified: 04-29-2015, 08:45 PM by behnampmdg3.)

Found it wow you wow you couldnt have guessed!!!!!!!!

The controller was blog.php not Blog.php!!!!!

I renamed it to capital B and it started to work!

Why is that?
Reply
#8

(04-29-2015, 08:39 PM)behnampmdg3 Wrote: Found it wow you wow you couldnt have guessed!!!!!!!!

The controller was blog.php not Blog.php!!!!!

I renamed it to capital B and it started to work!

Why is that?

Because Windows doesn't make a difference between 'B' and 'b'.
Reply
#9

(04-30-2015, 02:24 AM)Narf Wrote:
(04-29-2015, 08:39 PM)behnampmdg3 Wrote: Found it wow you wow you couldnt have guessed!!!!!!!!

The controller was blog.php not Blog.php!!!!!

I renamed it to capital B and it started to work!

Why is that?

Because Windows doesn't make a difference between 'B' and 'b'.

Maybe Windows doesn't make a difference between a Big "B" and a small "b", but ex girlfriends do! Wink
Reply




Theme © iAndrew 2016 - Forum software by © MyBB