I've been trying to redirect my subdomain buynow.mydomain.info to the product link which is https://www.2checkout.com/checkout/purchase?sid=******&quantity=1&product_id=1.
I tried the simple .htaccess line
Redirect 301 / https://www.2checkout.com/checkout/purchase?sid=******&quantity=1&product_id=1
but it doesn't work, it only redirects to https://www.2checkout.com/checkout/purchase without mentioning my product as it ignores the rest of the URL ?sid=******&quantity=1&product_id=1
I thought it might be a problem with the link which is HTTPS, but I can't solve it, I hope you guys could help me, thanks.
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) https://www.2checkout.com/checkout/purchase?sid=******&quantity=1&product_id=1 [R=301]
Related
I am a beginner in the REWRITING URL and in fact I replaced this link http://www.downisynet.rf.gd/article.php?id=14 with http://www.downisynet.rf.gd/tutoriel/14
Yet both links are still accessible.
So I want to know how to redirect the old URL to the new one?
Here is my .htaccess code:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^tutoriel-([0-9]+) article.php?tutoriel=$1 [L]
Thank you for helping me!
You can simply 301 redirect one page to another using .htaccess. Add the following to your .htaccess file:
RewriteEngine on
Redirect 301 /article.php?id=14 http://www.downisynet.rf.gd/tutoriel/14
Modified rule for /tutoriel/any-digit to /article.php?tutoriel=any-digit
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^tutoriel\/([0-9]+)$ /article.php?tutoriel=$1 [L]
i´m trying to do a 301 redirect in my .htaccess with the following lines:
Options +FollowSymLinks
RewriteEngine On
Redirect 301 /oldpage http://www.myhomepage.de/newpage/
The problem is, that the redirected url looks like this:
http://www.myhomepage.de/newpage/?it=oldpage
and that naturally causes a 404 on my site.
Does anybody know, what the problem could be?
Thanks a bunch!
This should work for you:
RewriteRule ^oldpage$ newpage? [R=301,L]
The question mark at the end of the destination will tell it to use a blank query string.
The above assume the pages are on the same domain. But if you're moving to another domain, this should do the trick:
RewriteRule ^oldpage$ http://newdomain.tld/newpage? [R=301,L]
My client has gone through a rebrand and has changed their primary URL. I need to redirect all traffic that visits old URLs and send them to the same page on the new URL and ideally append a #hashtag... the hashtag will trigger an overlay explaining the redirect. Both sites are on the same Drupal codebase and thus use the same .htaccess file.
So if someone visits:
http://oldsite.com/abc/def
They should be redirected to:
http://newsite.com/abc/def/#hashtag
Any help would be greatly appreciated.
something like this?
Though I'm no expert when it comes to htaccess trickery.
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.newdomain\.com
RewriteRule (.*) http://www.newdomain.com/$1/#hashtag [R=301,L]
I've checked many ways for redirecting old domain to new domain. But I did not find any way for that.
All my subfolder of my site is using subdomain address, such as myfolder.domain.com, so it built many many subdomains. Now I want to redirect all of them to new domain.
redirect *.olddomain.com to *.newdomain.com. Can anybody who know .htaccess can help me with this? I'd really really appreciate it! Thanks!
redirect *.olddomain.com to *.newdomain.com. Can anybody who know .htaccess can help me with this?
As long as all of your *.olddomain.com domains all point to the same document root, you can just put these rules in the htaccess file in that directory:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^([^.]+)\.olddomain\.com$ [NC]
RewriteRule ^(.*)$ http://%1.newdomain.com/$1 [L,R=301]
This will redirect the browser from:
http://foo.olddomain.com/bar.html to
http://foo.newdomain.com/bar.html
i have hosted two sites on same server and i mange them giving folders for each domain. i want to site comes as
example.com/example
example1.com/example1
i want to come
example.com and example.com
i come to know that htaccess url redirecting can do this but i have less idea about it.
if there is some tutorial on php regular expression please let me know.
some help is appreciable.
edited
i solved this problem by putting .htaccess file in root and writing:
RewriteEngine On
#for example.com
RewriteCond %{HTTP_HOST} example.com$ [NC]
RewriteCond %{REQUEST_URI} !^/example/.*$
RewriteRule ^(.*)$ /example/$1 [L]
when i hit example.com it works fine now. it access the folder /example. but i had a problem on a certain domain. i m using codeigniter and i have to redirect its request also so that it does not show
example.com/example/index.php/controller/
i want to show this:
example.com/controller/
hope some experts can help.
The .htaccess url redirecting is setup as a file in your main directory and your code can look something like this:
# These redirects should do the trick :-)
Redirect example.com/example http://www.example.com
Redirect example.com/example1 http://www.example.com