Hi
I am the developer for Magento 1.9 site at https://www.caferico.co.uk.
I plan to purchase a shortened domain (in the style of bit[dot]ly) for social media links. and add custom URL Rewrites to handle the shortened URL - which will all be caferico.co.uk URLs
so, cafe.co/123 will need to be forwarded to https://www.caferico.co.uk/vegware-catering-disposables
I plan to do this by aliasing the domain cafe.co to caferico.co.uk and setting up a URL Rewrite to /vegware-catering-disposables . My tests so far haven't worked, the shortened URL resolves to the home page and the path is ignored.
Has anyone else tried to do this? Any pointers would be gratefully received.
Regards
Kevin
Solved! Go to Solution.
DWJames
Thanks for the reply. Yes, the alias is causing the issue.
I solved it with a couple of lines in .htaccess
#Redirect from caferi.co to caferico.co.uk with full path and query string:
# If the hostname is NOT www.caferico.co.uk
RewriteCond %{HTTP_HOST} !^www\.caferico\.co.uk$
# 301 redirect to the same resource on www.caferico.co.uk
RewriteRule (.*) https://www.caferico.co.uk/$1 [L,R=301]
Regards
Kevin
Hi @kevin_russell,
Which application/sotware will handle the cafe.co/123 request?
Damian
The redirect will be handled by the Magento URL Rewrite. A 301 Permanent redirect from the shortened URL to the target URL. I think the problem is the use of an Alias.
Kevin
To be clear, this URL correctly redirects:
...this doesn't...
It simply resolves to www.caferico.co.uk
Regards
Kevin
Hi Kevin,
I don't see why you need your shortened domain setting up as an alias.
You should be able to do what you need by simple .htaccess or nginx rewrites per url from the short domain to the long one. No alias needed. I would guess this alias is what's causing your complication.
DWJames
Thanks for the reply. Yes, the alias is causing the issue.
I solved it with a couple of lines in .htaccess
#Redirect from caferi.co to caferico.co.uk with full path and query string:
# If the hostname is NOT www.caferico.co.uk
RewriteCond %{HTTP_HOST} !^www\.caferico\.co.uk$
# 301 redirect to the same resource on www.caferico.co.uk
RewriteRule (.*) https://www.caferico.co.uk/$1 [L,R=301]
Regards
Kevin