cancel
Showing results for 
Search instead for 
Did you mean: 

custom header url for logo

Occasional Contributor

custom header url for logo

I'm interested in having the header logo URL go to a custom URL (my home page url) rather than to the Magento home page. Is this possible? I know Magento is supposed to be a complete website/CMS, but I'm in the process of redesigning my site and have an external home page that I would prefer to link to. Thank you.

10 REPLIES
Moderator
Magento
E-Commerce

Re: custom header url for logo

Yes, you can do that but you'd need to change the template file to do it. See lines 33 and 35 of this file: https://github.com/OpenMage/magento-mirror/blob/magento-1.9/app/design/frontend/base/default/templat... which is the example in the base theme. You'll want to overwrite this template in your own theme and modify the hrefs. 

----
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!
Occasional Contributor

Re: custom header url for logo

Thank you, I'll give it a try. I'm not well versed in php to immediately know how to change the url (hrefs), but I think I'll figure it out. 

Occasional Contributor

Re: custom header url for logo

ok, so far no luck. The URL that is associated with the logo on my Magento cart pages is http://www.blueplanetphoto.com/dir/, which goes to the cart home page I don't use. I need the URL to go to blueplanetphoto.com for it to work the way I'd like. Thanks!

Moderator
Magento
E-Commerce

Re: custom header url for logo

Could you use a .htaccess rewrite instead? Something like:

 

RewriteRule ^dir/$ /? [L,R=301]
----
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!
Occasional Contributor

Re: custom header url for logo

I can try that. However, I see this in the Magento .htaccess file

 

############################################
## never rewrite for existing files, directories and links

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

############################################
## rewrite everything else to index.php

RewriteRule .* index.php [L]

</IfModule>


############################################

 

How would I alter or bypass these restrictions and apparent lock to redirect everything to the Magento index page?

Moderator
Magento
E-Commerce

Re: custom header url for logo

You would your rewrite condition above these lines so it applies first if applicable. 

----
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!
Occasional Contributor

Re: custom header url for logo

I've tried several variations of the RewriteRule, with RewriteCond without success. I've tested the RewriteRule with a couple online testers

In one tester, the rule you provided

RewriteRule ^dir/$ /? [L,R=301]

returned an error

No rules matched your query 'http://www.blueplanetphoto.com/dir/'

 

The rule that works in the tester is 

RewriteRule ^(.*)$ https://www.blueplanetphoto.com/

 

However, neither rule works when added to the htaccess file and placed second to the RewriteEngine on command line.

 

I'm adding this rule to the htaccess file in the /dir/ directory

Occasional Contributor

Re: custom header url for logo

I'm going to assume, then, it's not possible to add a URL redirect to the page logo, that clicking on my logo at the top of the page will always direct to blueplanetphoto.com/dir/ and not to my index.html home page - since Magento is a complete CMS intended to be the website, not an accessory to a website. Correct? Unless there's another file I need to change in addition to the htaccess file. I'm not well versed in this process, so it's entirely possible I'm missing something. I appreciate your help. Thank you.

Highlighted
Moderator
Magento
E-Commerce

Re: custom header url for logo

Hi, it's hard to help further from a distance really. It will be possible either by template change or by htaccess rule (I think I prefer this one) but it can be a bit tricky, especially the htaccess one. Unfortunately, I'm not sure quite why it's not working on your setup. 

----
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!