Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / What's The Easiest Way To Create A Direct Link In The Sidebox?

What's The Easiest Way To Create A Direct Link In The Sidebox?

Views: 8,808

Results 21 to 36 of 36
13 Jun 2017, 9:25 AM
#21
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

What's The Easiest Way To Create A Direct Link In The Sidebox?

mc12345678:

Might I suggest that until the to/from is correctly applied or identified that you use a 302 instead of a 301? (ie. A temporary move instead of a permanent move?) almost no telling how many different uris/servers have been redirected permanently for a "test".

Good point. I won't debate/argue, but I will state that Google isn't quick to take the 301'a as 'gospel'. IOW, it won't drop the original URL from its index just because it sees a 301 rather than a 302. Can't say about the other SE's.

Sorry, I can't seem to find the google page where I read about this though. I do remember that it came with a comment along the lines that 'people make mistakes' using 301's where a 302 was intended so they treat them both nearly identical - with 'time' being a factor in regards to how they get treated differently.

Cheers
RodG

13 Jun 2017, 9:34 AM
#22
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: What's The Easiest Way To Create A Direct Link In The Sidebox?

DK_Scully:

That didn't work, either. I selected the proper website name, and added zencart/index.php?main_page=index&cPath=343 in the second field. It created a redirect, but it didn't take the full url. Instead, it cut it off at www.carnal-pleasures.com/zencart/index.php and won't take the remainder. So of course it won't refresh anything. Any other suggestions? Thanks!

Hmm, can't say I've ever had a problem with truncation.

So, next suggestion (since you apparently need to edit the .htaccess directly) go to Google, search for "redirect .htaccess generator" - You'll find many sites where you can enter the source/destination URL's and they will generate the needed code. You then only need to cut n paste that into your own .htaccess file.

I honestly can't remember the last time I've ever actually typed code into an .htaccess file - It is so easy to make a mistake, and things really need to be 'perfect' in order to work. This is why I use one of the code generators. :) (no, I don't have a preference which one I use)

Cheers
RodG

13 Jun 2017, 9:35 AM
#23
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: What's The Easiest Way To Create A Direct Link In The Sidebox?

RodG:

Good point. I won't debate/argue, but I will state that Google isn't quick to take the 301'a as 'gospel'. IOW, it won't drop the original URL from its index just because it sees a 301 rather than a 302. Can't say about the other SE's.

Sorry, I can't seem to find the google page where I read about this though. I do remember that it came with a comment along the lines that 'people make mistakes' using 301's where a 302 was intended so they treat them both nearly identical - with 'time' being a factor in regards to how they get treated differently.

Cheers
RodG

I read somewhere that some browsers take things a little too seriously too quickly with my concern being less the ratings than the continued attempt to figure out which set of "rules" must be met to get the desired effect where it almost seems that both the origin and destination seem to be at question. :/

13 Jun 2017, 9:51 AM
#24
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: What's The Easiest Way To Create A Direct Link In The Sidebox?

DK_Scully:

and added zencart/index.php?main_page=index&cPath=343 in the second field.

Question. Was this what you typed in because you think it is what is needed, or did you copy this from the page that you are wanting to redirect?

DK_Scully:

Instead, it cut it off at www.carnal-pleasures.com/zencart/index.php

I assume that this is where you wish to redirect to? Until now you've been telling us that you wish to redirect to http://www.book-oasis.com so forgive me if I'm a little confused here. I'm not 100% sure, but it is possible that cPanel isn't allowing the destination to contain parameters because this could conflict with its 'Wild Card Redirect' (IOW, in your case, the cPanel is preventing you from achieving your aim). cPanel is only really good for simple cases - I suppose you could say that this is the reason the code generators exist - they go a step or three beyond what cPanel can do.

Cheers
RodG

13 Jun 2017, 10:02 AM
#25
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: What's The Easiest Way To Create A Direct Link In The Sidebox?

mc12345678:

I read somewhere that some browsers take things a little too seriously too quickly with my concern being less the ratings than the continued attempt to figure out which set of "rules" must be met to get the desired effect where it almost seems that both the origin and destination seem to be at question. :/

Wish you didn't do that. Browsers are pretty 'dumb' pieces of software. They don't 'remember' a 301 or 302 beyond their current session/cache, so in this regard, it really makes almost zero difference whether a 301 or a 302 is used. Close the browser and/or clear the cache, and everything is 'new' again. :)

Cheers
RodG

13 Jun 2017, 12:34 PM
#26
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: What's The Easiest Way To Create A Direct Link In The Sidebox?

RodG:

Wish you didn't do that. Browsers are pretty 'dumb' pieces of software. They don't 'remember' a 301 or 302 beyond their current session/cache, so in this regard, it really makes almost zero difference whether a 301 or a 302 is used. Close the browser and/or clear the cache, and everything is 'new' again. :)

Cheers
RodG
I don't disagree. It does require either the reset/clearing of the cache or other header information to be provided. The particular comment was made based on the lack of discussion of trying to clear the cache between tries which could be compounding the "it doesn't work" condition.

13 Jun 2017, 12:41 PM
#28
dk_scully avatar

dk_scully

Zen Follower

Join Date:
Jan 2011
Posts:
339
Plugin Contributions:
0

Re: What's The Easiest Way To Create A Direct Link In The Sidebox?

Here's the .htaccess file again:

DK_Scully:

@copyright Copyright 2003-2013 Zen Cart Development Team

@license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0

@version GIT: $Id: Author: IronLady Thu Aug 1 16:10:02 2013 +0100 Modified in v1.5.2 $

This is used with Apache WebServers

The following blocks direct HTTP requests to all filetypes in this directory recursively, except certain approved exceptions

It also prevents the ability of any scripts to run. No type of script, be it PHP, PERL or whatever, can normally be executed if ExecCGI is disabled.

Will also prevent people from seeing what is in the dir. and any sub-directories

For this to work, you must include either 'All' or at least: 'Limit' and 'Indexes' parameters to the AllowOverride configuration in your apache/conf/httpd.conf file.

Additionally, if you want the added protection offered by the OPTIONS directive below, you'll need to add 'Options' to the AllowOverride list, if 'All' is not specified.

Example:

#<Directory "/usr/local/apache/htdocs">

AllowOverride Limit Options Indexes

#</Directory>
###############################

Options +FollowSymLinks
RewriteEngine on

Redirect 301 /index.php?main_page=index&cPath=342 http://www.timelesserotica.com
Redirect 301 /index.php?main_page=index&cPath=343 http://www.book-oasis.com

13 Jun 2017, 12:46 PM
#29
dk_scully avatar

dk_scully

Zen Follower

Join Date:
Jan 2011
Posts:
339
Plugin Contributions:
0

Re: What's The Easiest Way To Create A Direct Link In The Sidebox?

Rod:

I'm trying to get http://www.carnal-pleasures.com/zencart/index.php?main_page=index&cPath=343 to redirect to http://www.book-oasis.com. And I copied it directly from the page. The redirect box cut it off at http://www.carnal-pleasures.com/zencart/index.php instead of taking the complete url.

13 Jun 2017, 12:52 PM
#30
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,967
Plugin Contributions:
8

Re: What's The Easiest Way To Create A Direct Link In The Sidebox?

i am not the king of apache redirects. that said, it looks like you are missing 'zencart' from your .htaccess file. try using the following:

Options +FollowSymLinks
RewriteEngine on

Redirect 301 /zencart/index.php?main_page=index&cPath=342 http://www.timelesserotica.com
Redirect 301 /zencart/index.php?main_page=index&cPath=343 http://www.book-oasis.com

that said, i think there is still a problem. as when i go to:

http://www.carnal-pleasures.com/index.php?main_page=index&cPath=342

i get a 404 (not found) error. and if the .htaccess was set up properly, that should be going to:

http://www.timelesserotica.com

a previous poster suggested using the cpanel to create the redirect. the .htaccess code you have posted does not look like it was created using cpanel. which is why i was asking for a new htaccess code.

so i see 2 problems. #1, it does not look like apache is processing the .htaccess file. #2 it looks like if it did, the redirects are wrong.

but again, i am NOT the king of apache redirection.

hope that helps. good luck!

13 Jun 2017, 1:06 PM
#31
dk_scully avatar

dk_scully

Zen Follower

Join Date:
Jan 2011
Posts:
339
Plugin Contributions:
0

Re: What's The Easiest Way To Create A Direct Link In The Sidebox?

I tried that yesterday...it didn't work, either.

DK_Scully:

I even tried changing the path so it says /zencart/index.php?main_page=index&cPath=343 http://www.book-oasis.com since the zencart program is in a folder. Nothing works.

13 Jun 2017, 1:20 PM
#32
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,967
Plugin Contributions:
8

Re: What's The Easiest Way To Create A Direct Link In The Sidebox?

carlwhat:

...#1, it does not look like apache is processing the .htaccess file.

your filename could be wrong. you could have it in the wrong place.

your redirects will not work if apache is not reading the file.

you need to ensure that apache is reading the file prior to figuring out the redirects. hostgator should be able to help you with that.

good luck!

13 Jun 2017, 1:26 PM
#33
dk_scully avatar

dk_scully

Zen Follower

Join Date:
Jan 2011
Posts:
339
Plugin Contributions:
0

Re: What's The Easiest Way To Create A Direct Link In The Sidebox?

The .htaccess file is in the https://www.carnal-pleasures.com/ root directory. Hostgator's hosting is pretty good, but their tech support can't find their way out of a wet paper bag with both hands and a road map. I gave up on asking them for help years ago.

14 Jun 2017, 4:06 AM
#34
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: What's The Easiest Way To Create A Direct Link In The Sidebox?

DK_Scully:

Rod:

I'm trying to get http://www.carnal-pleasures.com/zencart/index.php?main_page=index&cPath=343 to redirect to http://www.book-oasis.com. And I copied it directly from the page. The redirect box cut it off at http://www.carnal-pleasures.com/zencart/index.php instead of taking the complete url.

 
RewriteEngine On
RewriteCond %{HTTP_HOST}  ^www\.carnal-pleasures\.com$ [NC]
RewriteCond %{QUERY_STRING}  ^main_page=index&cPath=343$ [NC]
RewriteRule ^zencart/index\.php$ http://www.book-oasis.com/? [R=301,NE,NC,L]

Cheers
RodG

14 Jun 2017, 4:48 AM
#35
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: What's The Easiest Way To Create A Direct Link In The Sidebox?

DK_Scully:

Rod:

I'm trying to get http://www.carnal-pleasures.com/zencart/index.php?main_page=index&cPath=343 to redirect to http://www.book-oasis.com. And I copied it directly from the page. The redirect box cut it off at http://www.carnal-pleasures.com/zencart/index.php instead of taking the complete url.

This should also work.

Redirect 302 /zencart/index.php?main_page=index&cPath=343 http://www.book-oasis.com
14 Jun 2017, 7:40 AM
#36
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: What's The Easiest Way To Create A Direct Link In The Sidebox?

DK_Scully:

I'm trying to get http://www.carnal-pleasures.com/zencart/index.php?main_page=index&cPath=343 to redirect to http://www.book-oasis.com.

Add the following at the top of the .htaccess file for carnal-pleasures.com, removing any duplication further down in the file.

#############################
##  General Settings

# Some basic protection provided by Apache
Options +SymLinksIfOwnerMatch -FollowSymlinks -Indexes

# Define the default Character Set for Browsers
AddDefaultCharset utf-8

RewriteEngine ON


#############################
##  Rewrites

RewriteCond %{QUERY_STRING} cPath=343
RewriteRule .? [URL]http://www.book-oasis.com[/URL]/ [R=301,QSD,L]

Note that any URL having cPath=343 within it will be redirected.