killrwhale
05-22-2009, 07:42 PM
Hello,
I had a Godaddy shopping cart that had .hg and .sc files. I canceled that cart, but a lot of my product pages are still on Google. They usually looked like "www.mydomain.com/product.sc;jsessionid=0236......etc". Is it possible to create a product.sc file that forwards to my new cart?
Could I do this also with .hg files?
I do not know what kind of files these are and just want to forward them to a new site, is it possible?
Thanks
foobic
05-23-2009, 01:35 AM
As long as the old urls are under your own domain name, yes. People post regularly asking for mod_rewrite rules to do this sort of job - just post some examples of the existing url from Google and the product url you want to redirect it to and someone will help out.
killrwhale
05-26-2009, 05:51 PM
As long as the old urls are under your own domain name, yes. People post regularly asking for mod_rewrite rules to do this sort of job - just post some examples of the existing url from Google and the product url you want to redirect it to and someone will help out.
Hello,
Some examples of my url in google are:
mysite.net/product.sc?productId=1
mysite.net/product.sc;jsessionid=593BEBAF624F2606F35AC19B5E3EC33F.qscstrf...
I basically just want to be able to have those urls forward to just mysite.net
Is this possible with .sc files and the ?productid or ;jsessionid?
Thank You
oldunis
05-26-2009, 05:59 PM
If it is only for serveral files, it would be possible (I don't exactly remember how to) to use a .htaccess command to add a php (or whatever you like) mime type to .sc files. They will then act as php files and you will be able to properly redirect them to their new url.
killrwhale
05-26-2009, 06:04 PM
If it is only for serveral files, it would be possible (I don't exactly remember how to) to use a .htaccess command to add a php (or whatever you like) mime type to .sc files. They will then act as php files and you will be able to properly redirect them to their new url.
I would love that! Now who knows how? haha
foobic
05-26-2009, 06:49 PM
You don't need to mess around with PHP redirects, and the product.sc file doesn't need to exist. If you just want to send all the old links to your home page then something simple like this in your .htaccess should do it.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule product.(sc|hg) http://example.com/ [R=301,L]
</IfModule>
If you want something smarter (eg. productId=1 going to the equivalent new product page) that's also possible but you'll need to provide more info on how you're mapping old to new.
killrwhale
05-26-2009, 07:02 PM
You don't need to mess around with PHP redirects, and the product.sc file doesn't need to exist. If you just want to send all the old links to your home page then something simple like this in your .htaccess should do it.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule product.(sc|hg) http://example.com/ [R=301,L]
</IfModule>
If you want something smarter (eg. productId=1 going to the equivalent new product page) that's also possible but you'll need to provide more info on how you're mapping old to new.
Awesome, that worked perfectly. How do I do it with multiple file names? Do I just copy/paste, like I also have a viewcart.sc file.
RewriteRule viewcart.(sc|hg) http://example.com/ [R=301,L]
Would that just work? Thanks
foobic
05-26-2009, 07:18 PM
Yes, you can stack up multiple rules, or if you're sure your own urls don't contain a .sc or .hg you could use a wildcard to match anything.sc or anything.hg:
RewriteRule .*\.(sc|hg) http://example.com/ [R=301,L]
killrwhale
05-26-2009, 07:30 PM
Yes, you can stack up multiple rules, or if you're sure your own urls don't contain a .sc or .hg you could use a wildcard to match anything.sc or anything.hg:
RewriteRule .*\.(sc|hg) http://example.com/ [R=301,L]
Exactly what I needed. Thank you!