I would like to make a redirect from one link to another. I mean:
I have a site:
www.mysite.com/index.php and I can do it as www.mysite.com/home, so in URL user can see home instead of ugly index.php. But... Here comes the problem... I need to make a redirect from www.mysite.com/index.php#myId to www.mysite.com/myId.
I tried a lot of things via the .htaccess file but nothing worked. Is there any way to do it?
Related
I can't figure out how can I redirect my home page to different URL. I have found tutorials how to redirect to product or category page but these doesn't work in my case.
For example:
When someone goes to myprestashop.com they will be redirected to myprestashop.com/differentpage
Sorry, if it is very simple, I'm new to prestashop and ecommerce.
You can use the following code to redirect page to another page
From frontend:
Tools::redirect(Context::getContext()->link->getPageLink('abc', true));
If you want to redirect only one page to a specific page, it's better (and also easier) to use .htaccess to do this.
How to Redirect one Page url to another
I'd like to do the reverse of this issue. I am trying to redirect users from a subfolder to a child page. This is my current rule that doesn't work:
Redirect 302 /boston /boston/info
Using this, if I go to example.com/boston, I get redirected to example.com/boston/info/info/info/info/info/info... and it keeps going.
I imagine I'll need to switch to a RewriteRule in order to prevent this duplication. How should I go about this?
"/boston/info" - This should be the full URL you are redirecting too.
eg. www.website.com/boston/info
I am struggling with an url/parameter issue.
The main index.php page of my website was previously used for e.g.
www.domain.com/index.php?site=3&word=21 and
www.domain.com/index.php?site=3
But now I have changed those things, but in Google the URLs are still listed. So what I need is to redirect all the type of pages above to the main page/domain www.domain.com.
I believe .htaccess redirect is the right thing to use then, is that correct?
What type of code do I need to redirect those to main domain. Just the url's with parameters after index.php? etc. not other directories e.g. www.domain.com/sunshine/
Would be great if someone could help me with this. I believe it is actually a quick fix, but I have failed to get the code correct.
Thanks.
You can add this to an .htaccess in your site root:
RedirectMatch permanent ^/index.php* http://www.domain.com/
But, be careful if your new index page is also named index.php because you might run into a redirect loop.
I'm using cpanel and tried using htaccess and it's not working.. I need to redirect prismafoto.com.ar to brujaurbana.com.ar/prisma but when it does the url that is shown is brujaurbana.com.ar/prisma
How can I do this?? thanksss :(
Sounds like you are wanting to do a masked URL redirect. Meaning, you want the domain to redirect but stay the same in the URL bar.
http://webstarthelp.com/forwards.html
The above site has a great Masked URL Redirect.
Simply create a index.html file on prismafoto.com.ar and paste the generated code.
Make sure to clear the .htaccess file so redirects do not conflict.
I'm htaccess stupid and I'm confident this is an easy one for anyone who knows their stuff.
I have several landing pages that are on specific domains. One of the ways I like to track is off the links I use. Users could end up at domain.tld or domain.tld/abcdefg and see the landing page based off the directory.
My question is, how can a user end up at domain.tld/abc or domain.tld/123 and see the same page without actually 301 redirecting to the home page?
I was going to just run an iframe throughout, but I'm not sure how to leave the destination URL alone so it doesn't change to the home page.
I believe what you're looking for is simply this:
RewriteEngine On
RewriteRule ^(123|abc)$ /