I added this code to my .htaccess file in: https://www.revealio.com/agora
Redirect 302 / https://sales.revealio.com/agora?r_done=1
This should redirect it to our subdomain that is in the code. The problem is that it redirects to: https://sales.revealio.com/agoraagora
Why is it adding another agora onto the end of the URL. How can I fix this. I have tried commenting out everything in the .htaccess file located at https://www.revealio.com/agora other than the redirect. I also tried these:
Redirect 302 / https://sales.revealio.com/agora
Redirect 302 / https://sales.revealio.com/agora/
Use RedirectMatch instead of Redirect for precise regex based matching:
RedirectMatch 302 ^ https://sales.revealio.com/agora?r_done=1
Make sure to test from a new browser or clear your browser cache completely.
Related
I've made an htaccess file, but several testers tell me it's not right.
Domain B is going offline and I want to redirect all the pages to new pages on domain A.
This is the code:
redirect 301 / https://domain-A.com/
redirect 301 /page-1/domain-B/ https://domain-A.com/page-1/
redirect 301 /page-2/domain-B/ https://domain-A.com/page-2/
redirect 301 / https://domain-A.com/
redirect 301 /page-1/domain-B/ https://domain-A.com/page-1/
redirect 301 /page-2/domain-B/ https://domain-A.com/page-2/
Your rules are in the wrong order. The Redirect directive is prefix-matching. The first rule redirects everything (and preserves the URL-path). The second and third rules are never processed. (What exactly is the "tester" reporting? Is this a thrid party tool or a real "tester" person?)
If you request /page-1/domain-B/ you will see that you are not redirected as intended. (You are redirected to https://domain-A.com/page-1/domain-B/, not https://domain-A.com/page-1/ as would seem to be the intention.)
You need to reverse the order of these rules. The most specific needs to be first.
For example:
Redirect 301 /page-1/domain-B/ https://domain-A.com/page-1/
Redirect 301 /page-2/domain-B/ https://domain-A.com/page-2/
Redirect 301 / https://domain-A.com/
You will need to clear your browser cache before testing since the erroneous 301s will have been cached by the browser. Test first with 302 redirects to avoid caching issues.
/page-1/domain-B/
And /domain-B/ is actually in the URL-path?
https://example.com/folder/ needs to direct to https://example.com/folder.html
I added this to the htaccess,
Redirect 301 /folder https://example.com/folder.html
This works if the url is https://example.com/folder
However if the url is https://example.com/folder/ then it redirects to a broken url at https://example.com/folder.html/
How would I fix this so that https://example.com/folder/ redirects to https://example.com/folder.html/ without the trailing slash causing it to break?
Better to use a RedirectMatch rule that supports regex with more powerful matching options:
RedirectMatch 301 ^/folder/?$ /folder.html
Make sure to test it in a new browser or clear browser cache before testing.
I would like to add code line in .htaccess to redirect a package of url with the same pattern :
shop.my-example.com/blog/{my-cat}/{number}
To a new site :
https://my-new-site.com/blog/{my-cat}/{number}
For the moment I'm using this code line :
Redirect permanent /blog/ https://www.my-new-site.com/blog/
But it works only fr the url shop.my-example.com/blog/
Using RedirectMatch, You may use this rule as your top rule (before all other rules):
RedirectMatch 301 ^(/blog/.+)$ https://www.my-new-site.com/$1
Make sure to test in a new browser or clear your browser cache before testing this change.
I am having an htaccess issue that I cannot seem to figure out.
On my site I have several pages that have /wiget/ in the url.
.com/wiget/
.com/wigeta/
.com/wigeb/
.com/wigetc/
.com/shop/wigeta/
.com/shop/wigetb/
In my htaccess file I am using the following:
Redirect 301 /wiget/ http://www.site.com/content/wiget/
Redirect 301 /wigeta/ http://www.site.com/content/wigeta/
Redirect 301 /wigetb/ http://www.site.com/content/wigetb/
Etc.
What is happening, is that every URL with /wiget/ /wigeta/ /wigetb/ in it is getting redirected incorrectly. For example, these urls:
.com/shop/wiget/ is being sent to .com/shop/content/wiget/
.com/shop/wigeta/ is being sent to .com/shop/content/wigeta/
.com/shop/wigetb/ is being sent to .com/shop/content/wigetb/
What I want is only pages that have .com/wiget/ or .com/wigeta/ or .com/wigetb/ to be redirected to their .com/content/wiget{x}/ page
I am a rookie at htaccess and I cannot drum up the solution.
So basically you want to specify that your url have to start with /wiget/
RewriteRule ^/wiget/ /content/wiget/ [L,R=301]
Redirect 301 /features/blahblah.php http://www.mysite.com/articles/blahblah1.php
results in http://www.mysite.com/articles/blahblah1.php?q=features/blahblah.php which is a 404 error page not found.
So what am i doing wrong here
http://httpd.apache.org/docs/2.0/mod/mod_alias.html#redirect documents exactly what's happening.
You probably want to use RedirectMatch, something like:
RedirectMatch ^/features/blahblah.php http://www.mysite.com/articles/blahblah1.php
If you want it to be a "permanent" redirect with HTTP status 301 (which can be desirable for SEO purposes) rather than a temporary 302 redirect, then instead use:
RedirectMatch permanent ^/features/blahblah.php http://www.mysite.com/articles/blahblah1.php