HH Services Limited Posted June 22, 2016 Share Posted June 22, 2016 Hi, I am having an issue with smartblog module since it creates two url´s with the exact content and not only is not good for google, but it interrupts the module add this button from counting the post shares. How can I do so that one url gets completely redirected to another so that the customers never see it? Thanks. Link to comment Share on other sites More sharing options...
NemoPS Posted June 22, 2016 Share Posted June 22, 2016 Depends on the module, you can create a 301 redirect I guess, in the htaccess fileYou need to know the blog posts pattern and regex though, I guess it needs some work Link to comment Share on other sites More sharing options...
shokinro Posted June 22, 2016 Share Posted June 22, 2016 You may have a look at URL rewrite rule tutorial here https://www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/ Link to comment Share on other sites More sharing options...
HH Services Limited Posted June 22, 2016 Author Share Posted June 22, 2016 (edited) I have tried what is on the snapshot (.htaccess file) but it is not working, I can access all url´s without any redirection... How should have I done it to make it work? Thanks. Edited June 22, 2016 by HHServices (see edit history) Link to comment Share on other sites More sharing options...
Rosa Lynn Posted June 23, 2016 Share Posted June 23, 2016 Good question HHServices, I hope that someone can know this one... I am having a very similar issue... Link to comment Share on other sites More sharing options...
NemoPS Posted June 24, 2016 Share Posted June 24, 2016 The first url must be relative, you can get rid of the first part until .com/ Link to comment Share on other sites More sharing options...
HH Services Limited Posted June 24, 2016 Author Share Posted June 24, 2016 (edited) The first url must be relative, you can get rid of the first part until .com/ Sorry Nemo I dont quite understand. So what should I have typed instead? Maybe like this?: Also, did I place the code in the right part of the .htaccess file? Thanks for your support!! Edited June 24, 2016 by HHServices (see edit history) Link to comment Share on other sites More sharing options...
shokinro Posted June 24, 2016 Share Posted June 24, 2016 (edited) @HHServices I think what @Nemo mean is to remove whole "http://www.highesthelp.com/" from the first URL. So it starts from en/.... Edited June 24, 2016 by shokinro (see edit history) Link to comment Share on other sites More sharing options...
HH Services Limited Posted June 24, 2016 Author Share Posted June 24, 2016 like this?: Redirect 301 en/module/smartblog/category https://www.highesthelp.com/en/psychicblog.html Redirect 301 es/module/smartblog/category https://www.highesthelp.com/es/psychicblog.html Link to comment Share on other sites More sharing options...
NemoPS Posted June 25, 2016 Share Posted June 25, 2016 Yes, that should work, though it might want a slash as first character Link to comment Share on other sites More sharing options...
HH Services Limited Posted June 25, 2016 Author Share Posted June 25, 2016 Great, it works great: Redirect 301 /en/module/smartblog/category https://www.highesthelp.com/en/psychicblog.html Redirect 301 /es/module/smartblog/category https://www.highesthelp.com/es/psychicblog.html I think that I will have to do the same with every post that I place in this blog, because /en/module/smartblog/category redirects to https://www.highesthelp.com/en/psychicblog.html but /en/module/smartblog/category/newpost does not redirect to https://www.highesthelp.com/en/psychicblog/newpost.html Is there any way to create a rule that covers all new posts? Thank you. Link to comment Share on other sites More sharing options...
NemoPS Posted June 25, 2016 Share Posted June 25, 2016 You need regex.I am no regex [spam-filter] but you can try withRedirect 301 /es/module/smartblog/category/(a-zA-Z0-9\-)+ http://youraddress/whatever/$1.html $1 is the post name, enclosed between parenthesis Link to comment Share on other sites More sharing options...
HH Services Limited Posted June 25, 2016 Author Share Posted June 25, 2016 Thanks! I have tried: Redirect 301 /en/module/smartblog/(a-zA-Z0-9\-)+ https://www.highesthelp.com/en/(a-zA-Z0-9\-)+.html Redirect 301 /es/module/smartblog/(a-zA-Z0-9\-)+ https://www.highesthelp.com/es/(a-zA-Z0-9\-)+.html Without any success... Any other idea? Link to comment Share on other sites More sharing options...
NemoPS Posted June 27, 2016 Share Posted June 27, 2016 You do not have to use that pattern on the end url, just on the first partyou can try with ^/es/module/smartblog/(a-zA-Z0-9\-)+$ as wellIt depends on how the original url is anyway, like if it has .html or not Link to comment Share on other sites More sharing options...
HH Services Limited Posted June 27, 2016 Author Share Posted June 27, 2016 Sorry Nemo, I think that i didnt explain myself well. These redirections are for the smartblog module because every time that I create a post with it, it creates automatically two url´s with the same content. One with a prettier url than the other, so I was trying to find out if I could create a rule so that everytime that I create a post it automatically redirects one of the newly created url´s to the other one (the prettiest). ex: I created a post and it made these url´s: https://www.highesthelp.com/en/psychicblog/10_metaphysical-religion.html https://www.highesthelp.com/en/module/smartblog/details?id_post=10 I want to create many posts, so redirecting manually each post on every language after I create it will en up tiring. Do you think that I could create a rule for future posts? (each post with a different final url...) Thank you Nemo!! 1 Link to comment Share on other sites More sharing options...
Rosa Lynn Posted June 28, 2016 Share Posted June 28, 2016 Hello, I am having the same issue than HHServices, I hope that someone can help. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now