PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, December 30, 2021

[FIXED] Can't redirect from subdomain to main domain

 December 30, 2021     php, twitter-bootstrap, yii     No comments   

Issue

I have 2 projects. First project is in the main domain and the second project is in a subdomain. When I click on a menu item to redirect from subdomain to main domain, it redirects me to: https://subdomain.maindomain.com/https://maindomain.com/

Code:

echo Nav::widget([
    'options' => ['class' => 'navbar-nav navbar-right'],
    'items' => [
        ['label' => 'Menu 1', 'url' => ['https://maindomain.com/']],
        ['label' => 'Menu 2', 'url' => ['https://maindomain.com/1']],
    ],
]);

So I need just redirect to https://maindomain.com/ when click to menu in subdomain project.


Solution

Try putting URL outside of brackets. e.g.:

['label' => 'Menu 1', 'url' => 'https://maindomain.com/'],


Answered By - MLFR2kx
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing