Wix: Redirect a User-Agent To A Specific Page? - user-agent

What would be the best way to redirect a user-agent such as 'google-bot' or 'bing-bot' to a specific page on my wix-site.
Thank you.

You can do this using Wix Routers and redirect() - only thing is that Wix Routers are only available on Router and Dynamic Pages, not normal site pages.
In the Wix Router Request object you get the user agent

Related

frindly routing in joomla

I am doing a website in joomla 3.0, I have select a friendly URi in the backend.
I create several componente for the website too, and my route to access to this component is like this.
<?php $link =JRoute::_('index.php?option=com_projects&view=proyectos&format=raw&task=proyecto&id='. $item->id);?>
But when the browser show this router it isn´t friendly router.
Any idea?
You need to create a router.php file for your component to tell joomla how to build the sef url and then parse it when the sef url is requested.
Check out the components/weblinks/router.php file for an example.
Alternatively, if you are using a sef component like joomsef or sh404sef, you will need to create a plugin for your component. You can find documentation on how to do this on the component makers websites.

Change magento theme/storeview based on referring URL?

What’s the best way to change the theme or store view of a site based on the referring URL?
I have the following scenario:
SiteA.com with custom theme
SiteB.com sends traffic to SiteA.com
When that traffic arrives, I’d like it to have a different header, footer and some css overrides.
How can I accomplish this?
Main index.php file is best place to do this. Examine the referring url and change params passed to Mage::run method on line 88;
Mage::run($mageRunCode, $mageRunType);
I found this page, Change Store View by Referrer URL, I believe this may solve my problem.

Magento getProductUrl() is always returning HTTP

Even when I am on HTTPS, Magento's getProductUrl() always seem to return an HTTP URL. Any ways I can make this auto-switch to HTTPS? (or have it return relative protocol url).
I would say it's a rather 'standard' configuration.
Base URL is http://example.com/
Secure URL is https://example.com/
Use Secure URLs in Frontend is No
Base Link URL is {{unsecure_base_url}}
I am aware I could change the above to {{secure_base_url}} however I do not want to force a change from HTTP to HTTPS, I only need it to stay relative.
The main Magento's benefit, is that you can do anything you want with it :) So, yes, you can output HTTPS product urls or relative ones. However, before choosing a solution, let's consider the Magento authors' vision.
The HTTPS for frontend is designed to work only for specific areas like Customer account, Payment methods, Checkout, etc. There is nothing so private about products, which makes it necessary to be viewed via HTTPS as well.
By default Magento doesn't use HTTPS even for pages, mentioned above. In order to turn HTTPS on, the "Use Secure URLs in Frontend" option must be set to "Yes". Which, as described, will engage HTTPS only in limited set of pages that contain some private data.
So the best solution for you depends on specifics of the store, you are developing.
1) If you want to engage HTTPS for all the pages on frontend - then the best solution is to put "https://..." into "Base URL" option for "Unsecure" web url configuration.
2) If you want to turn on HTTPS only for product links and only for a limited number of pages, then you can override templates of that pages in order to put there relative urls. The actual code can be implemented in any way you like, even the simplest already proposed way is ok:
echo trim($_product->getProductUrl(),'http:')
3) If you want to engage HTTPS for all the product links at frontend - then the best way is to override Mage_Catalog_Module_Product_Url model and change method getUrl() - you need to put there
$routeParams['_secure'] = true;
This will produce all the product urls with HTTPS protocol.
4) If you need to show HTTP product links only at HTTP pages and HTTPS product links only at HTTPS pages, then you can use method 3) with a more sophisticated logic: check the protocol of current page before setting '_secure' parameter.
Hope, it helps.
I just did it the primitive way, sometimes it works best:
echo trim($_product->getProductUrl(),'http:')
Instead
$product->getProductUrl()
Try
$product->getUrlModel()->getUrl($product, array('_secure'=>(bool)Mage::app()->getStore()->isCurrentlySecure()))
This gives you a secure/unsecured product url based on your current protocol.
THere's an understated but important option in System | Configuration | Web ~ where you have to say "use secure url in frontend" -- if you set this to yes then a page loaded by https will use https links,
no need to write code or provide additional configuration in most cases

IIS 7.5 URL Rewrite Different Domains pointed to a single site

I have a single site at www.domain1.com. It's a PHP site being hosted on a Windows 2008/IIS 7.5 box. I need to set up www.domain2.com so that users are redirected to www.domain1.com/subfolder. To the user, they still see www.domain2.com in the address bar but are looking at the www.domain1.com/subfolder.
Any help on how to achieve this would be greatly appreciated!
You need to use IIS Application Request Routing and Url Rewrite modules. This walkthrough describes almost exactly what you are trying to achieve.

MVC Routing / HostHeader does not work when I use RequireHttps

I'm currently experiencing an issue whereby my MVC site is not responding correctly using IIS 6.
I've setup a url as http://mysite.co.uk which automatically redirects to the correct MVC home page. As the site contains sensitive information I have added the [RequireHttps] attribute to each controller class to automatically redirect the browser to an https url of https://mysite.co.uk which works correctly.
When I access the site as http://www.mysite.co.uk the site correctly redirects to https://www.mysite.co.uk/Default.aspx but it then responds with
Bad Request (Invalid Hostname)
It looks like any time I use www. as part of the url it fails to respond but I have a hostheader setup as www.mysite.co.uk under the IIS website. Is there anything in particular I need to do to make MVC understand the www. part of the url in terms of routing?
Thanks,
Brian.
IIS 6 doesn't add ssl host headers as you think it would. see my article at:
http://completedevelopment.blogspot.com/2009/06/multiple-host-headers-ssl-and-wcf.html

Resources