Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-30-2007, 01:07 PM
pagetta's Avatar
WebProWorld Veteran
 

Join Date: Nov 2004
Location: UK
Posts: 505
pagetta RepRank 2
Default another ht access query...

Our main product page is www.mysite.com/solutions/my-main-product.html, and as our company has grown we have now added more pages on these products these pages all sit in a folder called www.mysite.com/my-main-product/modulename.html, but the main page resides at its origianl URL in 'solutions' as it has all the links, rankings etc.

Now we are putting out a print advert and want to set up a simple url for our main product:
www.mysite.com/my-main-product
so essentially an index page within www.mysite.com/my-main-product/ So i made the index.html page and then put a 301 redirect in the htaccess that read

redirect 301 /my-main-product/ http://www.mysite.com/solutions/my-main-product.html

this works fine - only problem is that there are images within the 'my-main-product' folder that are used throughout the site and these links break when that line above is in the htaccess file as the img url link becomes "http://www.mysite.com/my-main-product.html/imagename.gif"

the redirect is adding the extension to the image url.

is there a way to implement the redirect using htaccess and not have to move all these images

OR

can i use a javascript redirect, and then block that page from the SEs since it is only for those coming from print media anyhow so the SEs need never ever see www.mysite.com/my-main-product/index.html. would using this JS redirect have any adverse effect on any other pages in my site, espexially the one it is redirecting to, if the SEs never see it?

hope i have explained this issue coherently and thanks for any advice offered.
Reply With Quote
  #2 (permalink)  
Old 05-30-2007, 02:41 PM
WebProWorld Pro
 

Join Date: Sep 2005
Location: Manchester, UK
Posts: 257
mikesmith76 RepRank 0
Default Re: another ht access query...

Not sure if you have mod_rewrite installed but if you do give this a shot

Code:
RewriteEngine on

RewriteRule ^my-main-product/$ http://www.mysite.com/solutions/my-main-product.html [R=301,L]
This should be placed in the .htaccess file in the root of your site, and should redirect requests for http://www.mysite.com/my-main-product/ only.

Mike
Reply With Quote
  #3 (permalink)  
Old 05-30-2007, 06:57 PM
RegDCP's Avatar
WebProWorld Pro
 

Join Date: Oct 2005
Location: Courtenay BC
Posts: 223
RegDCP RepRank 0
Default Re: another ht access query...

If you are redirecting, why make the person reading the ad type in the extra folder information? Why not just make it URL.com and be done with it?

Instead of using a redirect why not incorporate an index page for this directory?

IMO this is the perfect place for a targeted landing page.

Do a source code copy of your main page, change the main content to suit, (I include a copy of the print ad as a bit of a visual confirmation for the visitor), and save it as the index page.

Reg
__________________
http://DotCom-Productions.com Website Management
http://0Grief.com Budget PHP/MySQL hosting
Reply With Quote
  #4 (permalink)  
Old 05-30-2007, 08:23 PM
DrTandem1's Avatar
WebProWorld 1,000+ Club
 

Join Date: Oct 2003
Location: Encinitas, CA
Posts: 1,908
DrTandem1 RepRank 2
Default Re: another ht access query...

Two solutions.

1) duplicate the images in another image directory that resides in the new directory.

For instances, if your images are currently found in yoursite.com/images you need to duplicate the that images directory and its contents in the new directory as follows:

yoursite.com/new-directory/images

2) Simply source the images on the page(s) that reside in the new directory to the root directory.

So, while your images on the regular pages may be sorced as:

images/theimage.gif

The images in the new directory would be sourced as so:

../images/theimage.gif


The advantage to the second method is that you save on file space. The disadvantage to the second method is that you have to change the sourcing in the code of every image on every page. This can be accomplished with a global find and replace rather quickly.

The advantage to the first method is it requires no change in the coding and a simple one-time creation of a new image sub directory and then the FTP of the contents from the original.
__________________
DrTandem's San Diego Web Page Design, drtandem.com
Reply With Quote
  #5 (permalink)  
Old 05-31-2007, 08:42 AM
pagetta's Avatar
WebProWorld Veteran
 

Join Date: Nov 2004
Location: UK
Posts: 505
pagetta RepRank 2
Default Re: another ht access query...

Mike smith thanks for that code it works a treat but i have FD search installed and when i put this code into htaccess it stops the FD search from working will look into that.

Reg that's not a bad idea but we have multipl print ads for different modules of the product so would need either multiple trageted landingpages or can just send them to the mian product page as we would prefer to do.

thanks for the advice if anyone knows anything about Fluid dYNAMICS SEARCH WOULD BE HUGe help!
Reply With Quote
  #6 (permalink)  
Old 05-31-2007, 08:55 AM
WebProWorld Pro
 

Join Date: Sep 2005
Location: Manchester, UK
Posts: 257
mikesmith76 RepRank 0
Default Re: another ht access query...

When you say it stops working, does it display any errors at all?

Also do you have anything else in your .htaccess file?
Reply With Quote
  #7 (permalink)  
Old 06-01-2007, 09:08 AM
pagetta's Avatar
WebProWorld Veteran
 

Join Date: Nov 2004
Location: UK
Posts: 505
pagetta RepRank 2
Default Re: another ht access query...

it says i don't have permission to access the server.

the only other things in my htaccess are 301 redirects
Reply With Quote
  #8 (permalink)  
Old 06-02-2007, 10:54 AM
WebProWorld Pro
 

Join Date: Sep 2005
Location: Manchester, UK
Posts: 257
mikesmith76 RepRank 0
Default Re: another ht access query...

I can't understand why a simple rewrite would prevent access to the server, or cause a forbidden error message.

Unfortunately I don't have much experience with the search engine you are using, but I presume you can block certain directories from being indexed? try blocking the redireted directory (/my-main-product/) and see if that changes anything.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL query works on CLI or Query Browser but NOT in PHP CraigB Database Discussion Forum 4 09-28-2006 11:39 AM
CSS query EmmaGale Web Programming Discussion Forum 0 03-05-2006 08:09 PM
CMS Query syberboy Web Programming Discussion Forum 0 12-22-2005 08:23 PM
Access to MySql to Access Fendermate Database Discussion Forum 3 10-06-2005 12:03 PM
access database access tfinch Web Programming Discussion Forum 6 07-27-2004 11:28 PM


Search Engine Optimization by vBSEO 3.2.0