301 Redirects Revisited

I feel clueless, but I’ve reviewed the other 301 redirect threads and I’m just not getting this. Looking elswhere on the web, general 301 tutorials are just Too Much Information!



I am moving my site from one old cart and hosting service to CS Cart and new hosting, with the same domain. Google has only taken notice of about a dozen particular URLS, so I am thinking that I should just write specific redirects for those and then make a blanket statement that will get any old-format URL to my new homepage.



So, can anyone tell me:


  1. do I list the specific redirects first, and the blanket statement after, or vice-versa?


  2. HOW do I write a 301 redirect to get www.starfishandseashells.com//scripts/prodList.asp?idCategory=33 to show up at [I][url]http://www.starfishandseashells.com/coral/natural-decorative-coral.html[/url][/I] ?? I thought I had the format for that, but there[COLOR=“Black”]/[/COLOR]are[COLOR=“Black”]/[/COLOR]slashes[COLOR=“Black”]/[/COLOR]everywhere and I just don’t understand the protocol with this thing. :confused:



    Any help offered is greatly appreciated, my head is spinning…

[quote name=‘Dardanus’]I feel clueless, but I’ve reviewed the other 301 redirect threads and I’m just not getting this. Looking elswhere on the web, general 301 tutorials are just Too Much Information!



I am moving my site from one old cart and hosting service to CS Cart and new hosting, with the same domain. Google has only taken notice of about a dozen particular URLS, so I am thinking that I should just write specific redirects for those and then make a blanket statement that will get any old-format URL to my new homepage.



So, can anyone tell me:


  1. do I list the specific redirects first, and the blanket statement after, or vice-versa?


  2. HOW do I write a 301 redirect to get www.starfishandseashells.com//scripts/prodList.asp?idCategory=33 to show up at [I][URL]http://www.starfishandseashells.com/coral/natural-decorative-coral.html[/URL][/I] ?? I thought I had the format for that, but there[COLOR=Black]/[/COLOR]are[COLOR=Black]/[/COLOR]slashes[COLOR=Black]/[/COLOR]everywhere and I just don’t understand the protocol with this thing. :confused:



    Any help offered is greatly appreciated, my head is spinning…[/quote]



    If you have Cpanel it should be easy to do just call your webhost if you need help.

D’oh! That’s an option. :oops:



Thanks!

[quote name=‘Dardanus’]D’oh! That’s an option. :oops:



Thanks![/QUOTE]





By the way a beautiful photo under your name.

Thanks! Shot that in Yosemite, somewhere on the trail between upper and lower Yosemite Falls.

[quote name=‘Traveler’]If you have Cpanel it should be easy to do just call your webhost if you need help.[/quote]

The cPanel can’t create advanced redirects. Below is an example, how it looks like if you use cPanel:


RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteRule ^scripts\/prodList\.asp$ "http\:\/\/www\.domain\.com\/coral\/natural\-decorative\-coral\.html" [R=301,L]
as you can see, there is missing a part of the url


?idCategory=33 I posted in other thread .htaccess rewrite rules which are working with CS-Cart. There are 2 different codes; one for product URLs and another for categorie URLs

[quote name=‘indy0077’]…as you can see, there is missing a part of the url [/QUOTE]



Which is exactly why my head was spinning. I had tried Cpanel before starting this thread, then saw it was clipping the URL. Wasn’t sure if it was me or Cpanel.



I’ll go check your other thread, Indy, thank you. Who knew a dozen redirects could be such a hassle? Ion_Cannon handled over 1200 of them in less time than it is taking me to get a grip on this!

[quote name=‘Dardanus’]I’ll go check your other thread, Indy…[/quote]

Here is the link [URL]http://forum.cs-cart.com/showthread.php?p=78373#post78373[/URL]

OK, thank you, Indy for posting the redirect template. I do appreciate eveyone’s help and want to make that clear, because I am at my wit’s end with this .htaccess page.



I have been working with redirects all day, and NOT ONE THING has redirected anything to anywhere other than a 404. NOTHING!!! Not Indy’s format, not other people’s formats, not cPanel’s half-a$$ed format, nothing. I will certainly not bar the possibility that I am doing something tragically wrong. It’s confusing because this really does not look like rocket science, yet after a full day wasted I still have nothing.



The default URL-rewriting function is working, and that is it. No matter what I try to add to this .htaccess page, it will not work. There does not seem to be anything in the KB, and everything I have tried from other threads has gotten me nowhere.



Please, there must be some simple, stupid thing I am missing… has anyone else fought a war to get a redirect working, and what had to happen to get it done? For the record, I pasted the default URL-rewrite code into the top of the .htaccess page, and I am trying to put any other redirects after that. Is there something more than that to it? Something that is supposed to come between the two things? Is this just impossible and I should quit wasting my time?



Please understand that I am not complaining about the forum (or the cart) and appreciate all the time that others give, posting help to us newbies. I have found many, many answers here (mostly without asking, because there’s almost always a helpful thread already in existence). It’s just late and I’m totally baffled.



Hopefully, someday you’ll be reading answers from me instead of more questions!

[quote name=‘Dardanus’]OK, thank you, Indy for posting the redirect template. I do appreciate eveyone’s help and want to make that clear, because I am at my wit’s end with this .htaccess page.



I have been working with redirects all day, and NOT ONE THING has redirected anything to anywhere other than a 404. NOTHING!!! Not Indy’s format, not other people’s formats, not cPanel’s half-a$$ed format, nothing. I will certainly not bar the possibility that I am doing something tragically wrong. It’s confusing because this really does not look like rocket science, yet after a full day wasted I still have nothing.



The default URL-rewriting function is working, and that is it. No matter what I try to add to this .htaccess page, it will not work. There does not seem to be anything in the KB, and everything I have tried from other threads has gotten me nowhere.



Please, there must be some simple, stupid thing I am missing… has anyone else fought a war to get a redirect working, and what had to happen to get it done? For the record, I pasted the default URL-rewrite code into the top of the .htaccess page, and I am trying to put any other redirects after that. Is there something more than that to it? Something that is supposed to come between the two things? Is this just impossible and I should quit wasting my time?



Please understand that I am not complaining about the forum (or the cart) and appreciate all the time that others give, posting help to us newbies. I have found many, many answers here (mostly without asking, because there’s almost always a helpful thread already in existence). It’s just late and I’m totally baffled.



Hopefully, someday you’ll be reading answers from me instead of more questions![/QUOTE]



Ok, if you only have a dozen or so url’s to redirect, then here is a basic example to gitter done:



Just add each redirect on a seperate line at the bottom of your .htaccess file in the root of your store, here is an example redirecting a contact page with a different folder structure on the same site to your new folder/file name:


Redirect 301 /store/pc/contact.asp http://www.yoursite/contact.html



So, if your old page url was www.dardanussite.com/store/pc/contact.asp you would be redirecting it to www.dardanussite.com/contact.html

[quote name=‘Struck’]Redirect 301 /store/pc/contact.asp http://www.yoursite/contact.html



So, if your old page url was www.dardanussite.com/store/pc/contact.asp you would be redirecting it to www.dardanussite.com/contact.html[/QUOTE]



Yes, thank you, Struck, that is exactly what I am trying to do… unfortunately I just tested with my info and it still does not work. :mad: The mod rewrite function is working (I have flat URLs) so the .htaccess file itself and mod_rewrite on the server seem to be engaged and operational. Process of elimination suggests it is either the additional redirect code, or possibly something in the hosting environment, the browser, or the operator herself (ahem).



The continuing failure (of many formats and methods) is making me wonder if something is amiss on the hosting side, and I am going to ask them next.



This is a seriously dumb question, but if I set up the example given above, then I point my browser to www.dardanussite.com/store/pc/contact.asp shouldn’t I immediately see www.dardanussite.com/contact.html in the address bar and that content in my browser window? The constant fail makes me think that the browser is looking for /store/pc/contact.asp, not redirecting, and of course it won’t find the requested page, so it just stops on 404. Which leads me to conclude that something is wrong with my redirects.



Curiouser and curiouser.

OK, I’ve been reading even more, and it seems that part of my issue is that I’m redirecting dynamic urls. According to this guy, that’s something of a shot in the dark under the best circumstances and probably why all the generously-posted code samples here have not worked for me.



What I have learned is that Struck’s solution is fine for moving static urls to static urls, but redirecting dynamics requires code that looks more like Indy’s contribution referenced upthread. The problem is that there are still other possible ways to “say” it depending on what my server is expecting, so I guess that is why her code didn’t work for me (I’m sure it does for others, or she would not have posted it.) So, please, debate these points if you will, I hope someone can tell me I’m wrong!



It looks like one I have option is to keep trying different options until I happen upon the one that works. The other is to consider the value of this pagerank vs. the value of just launching the site and turning Adwords loose on it (which is where I currently get most of my traffic anyway.)



The domain is well-established but the old cart is difficult/impossible to optimize, so it’s not like I have hundreds of high-ranking URLS to worry about. One or two are #1 for some niche-market keywords, and I do get clickthough from them, BUT this whole move was prompted by horrible performance from my old cart. It’s so bad I can’t even use Adwords right now, because people get there and they can’t check out. I’ve outgrown the cart and need something more robust and SEO friendly, and so far CS-Cart has more than exceeded my expectations.



Some of you are much more experienced with these things than I am. Should I keep trying with the redirects, or just launch and concentrate on SEO going forward? I could certainly be driving traffic with Adwords in the meantime, which gives me a decent ROI, especially since my best season is NOW. Every day that I battle with this, I’m losing money.

Hello Dardanus,



Sorry for the late reply, just overwhelmed with todos right now!



Ok, after looking over your “situation”, the problem appears to me that your old .asp based store which you are attempting to redirect url’s from is still in operation!

[url]http://www.starfishandseashells.com/Store/Scripts/default.asp[/url]



You won’t be able to redirect the .asp based url’s from this store to your new CS-Cart store until you shut the old store down! :o

After you do this your urls will redirect properly as I explained above.

[quote name=‘Struck’]Hello Dardanus,



Sorry for the late reply, just overwhelmed with todos right now!



Ok, after looking over your “situation”, the problem appears to me that your old .asp based store which you are attempting to redirect url’s from is still in operation!

[URL]http://www.starfishandseashells.com/Store/Scripts/default.asp[/URL]



You won’t be able to redirect the .asp based url’s from this store to your new CS-Cart store until you shut the old store down! :o

After you do this your urls will redirect properly as I explained above.[/quote]

Hi Struck,



are you sure with [quote]“You won’t be able to redirect the .asp based url’s from this store to your new CS-Cart store until you shut the old store down!”[/quote]I don’t think so. If the .htaccess file is in the root of starfishandseashells.com then the redirect has to work. It doesn’t matter if the site is live or not.

[QUOTE]I don’t think so. If the .htaccess file is in the root of starfishandseashells.com then the redirect has to work.[/QUOTE]



But it is not Indy, http://www.starfishandseashells.com takes you to a landing page



I guess the next question should be, where is the CS-Cart store installed??

[QUOTE]I guess the next question should be, where is the CS-Cart store installed??[/QUOTE]



This is where it gets crazy :mrgreen:



Right now, as you have noticed, http://www.starfishandseashells.com is live and coming to you via My Old Hosting Provider.



CS-Cart, meantime, is still being tested via [url]http://ip.ad.dr.es.s/~myusername/index.php[/url], installed at Totally New Hosting Company. That’s where .htaccess is located as well - the cart and the .htaccess file are all in /public_html.



So, what I am actually coding in the .htaccess is redirects from store/scripts/whatever (dynamically generated urls, all starting with the above two folders) to [url]http://ip.ad.dr.es.s/~myusername/new/destination.html[/url].



The reason I’m putting the temp URL in the .htaccess for now is that I just want to ensure that the redirects work FIRST. Once that is tackled, I will have a mad rush as follows:


  1. Install my re-issued SSL cert on Totally New Hosting Company, which will immediately invalidate the SSL on My Old Hosting Provider. Live site goes into catalog mode at that time, to prevent any unsecure transactions from taking place.


  2. As quickly as possible, test everything to make sure the SSL itself is working, everything is still passing correctly to/from Authorize.net under SSL, any other last minute details are checked, and above all change all the temp URLs to www.starfishandseashells.com in .htaccess:slight_smile: .


  3. Cross fingers and point the DNS servers to the CS-Cart site at Totally New Hosting Company.



    According to all I’ve been reading (which is A LOT), it should be the case that any attempt to access [url]http://ip.ad.dr.es.s/~myusername/store/scripts/prodList.asp?idCategory=168[/url] should still end up at [url]http://ip.ad.dr.es.s/~myusername/wedding-favorites.html[/url] IF the redirect is working. And, it should keep working once once the DNS is repointed and the attempt becomes [url]http://www.starfishandseashells.com/store/scripts/prodList.asp?idCategory=168[/url], because the redirect will be then be to [url]http://www.starfishandseashells.com/wedding-favorites.html[/url].



    Apparently I just have not found the exact syntax that my hosting environment is expecting. Or, something altogether else is wrong. With the complexity and power of mod_rewrite I am not surprised that there are issues, just wishing there was some easy answer.



    With all that backstory, maybe now any operator error on my part is evident?

For example this should to work if he want to redirect the /Store/Scripts/default.asp to the root [URL]http://www.starfishandseashells.com/[/URL]



The .htaccess file must be in the root of starfishandseashells.com


RewriteEngine on
RewriteRule ^/Store/Scripts/default.asp$ http://www.starfishandseashells.com/? [R=301,L]
or

RewriteEngine on
RewriteRule ^/Store/Scripts/default\.asp$ http://www.starfishandseashells.com/? [R=301,L]

And yes, i did try asking my hosting company about it. Had a long emailed conversation with a tech last night, but he was proposing meta-refresh redirects and didn’t seem to be aware why we would put 301 redirects into .htaccess in the first place. So, A for effort, but not the information I need.



I did confirm that mod_rewrite and mod_alias are installed and working. The code that rewrites my CS-Cart URLs has been, and is, working fine so the problem seems to lie with my redirect attempts specifically.

Yeah, I knew there was something very whacky going on! :smiley:



I think you are making this much more difficult than it has to be!



If your new CS-Cart store is fully ready to go live, your SSL cert is installed, you have done some test orders, etc. etc., then just change your domain name server details for starfishandseashells.com so that it points to the new CS-Cart store IP address. Then, you can determine which of your old store url’s are actually indexed by google and redirect whichever are important to you to your new CS-Cart url’s. You should have the old URL’s saved & ready so you can make a mad dash on “D-Day” to get the re-directs in place. If you only want to redirect approx a dozen or so, then it should not take more than an hour or so to get the 301’s working.

[quote name=‘indy0077’]The .htaccess file must be in the root of starfishandseashells.com[/QUOTE]



Maybe my biggest problem is trying to resolve this before pointing the DNS to my new location?



I thought about pointing first and redirecting after, but I’m scared that there will still be redirect problems and that Google will 404 on my old pages before it gets resolved.



Maybe I am worrying too much?