Jump to content

Recommended Posts

Posted

I have have a shopping directory that i recently switched the script that was used to run it. As a result the directory structure was changed. I am trying to use the 301 redirect to point the old directory structure to the new one.

 

I was using the cpanel redirect page to create mine and it is not working on some of the redirects.

 

For example:

 

This redirect:

 

Redirect permanent /listings/clothing_apparel/large_tall_sizes http://www.shoppingaide.com/categories/Clo...d_Tall_Clothing

 

When I go to http://www.shoppingaide.com/listings/cloth...arge_tall_sizes

 

It takes me to: http://www.shoppingaide.com/categories/Clo...arge_tall_sizes which doesn't exist and for some reason brings up my index page (not my 404 error page).

 

Any ideas whats wrong?

Posted

Hi,

 

It looks as if you are redirecting to a directory that does not exist (Clothing_and_Apparel) which is the first problem.

 

You then have a redirect in the directory (categories) that is the parent of your non existent directory.... which redirects (using the .htaccess file) to your index page.

 

I hope that makes sense ;)

Posted

This redirect works:

 

>Redirect permanent /listings/clothing_apparel/mens_clothing http://www.shoppingaide.com/categories/Clothing_and_Apparel/Mens_Clothing

 

But this does not:

 

>Redirect permanent /listings/clothing_apparel/large_tall_sizes http://www.shoppingaide.com/categories/Clothing_and_Apparel/Large_and_Tall_Clothing

 

And the page does exist:

 

http://www.shoppingaide.com/categories/Clo...d_Tall_Clothing

 

 

 

But when I go to the page that should redirect

>http://www.shoppingaide.com/listings/clothing_apparel/large_tall_sizes

 

It tries to redirect to this URL:

 

>http://www.shoppingaide.com/categories/Clothing_and_Apparel/large_tall_sizes

 

instead of

>http://www.shoppingaide.com/categories/Clothing_and_Apparel/Large_and_Tall_Clothing

 

It is putting the end directory from the redirect (large_tall_sizes) at the end of the redirect URL instead of what was entered in the redirect (Large_and_Tall_Clothing)

 

????

Posted

PS. the script uses mod rewrite to create these directories. However the redirect seems to work just fine for some.. but not work on others.

 

Here is the .htaccess mod rewrite the script created in case its something in there thats the cause. I don't know much about mod rewrites.. the script created this automatically.

 

>RewriteEngine on

# If not working, uncomment and correctly fill the line below:
# RewriteBase  /

RewriteCond    %{REQUEST_FILENAME}  -d
RewriteRule    ^(.+[^/])$           $1/  [R]

RewriteRule ^admin$ admin/index.php
RewriteRule ^admin/$ admin/index.php

RewriteRule ^links/([a-z]+)/([0-9]+)$ link.php?action=$1&id=$2
RewriteRule ^links/([a-z]+)/([0-9]+)/$ link.php?action=$1&id=$2
RewriteRule ^links/([0-9]+)$ link.php?id=$1
RewriteRule ^links/([0-9]+)/$ link.php?id=$1

RewriteRule ^thread/([0-9]+)$ comments.php?id=$1
RewriteRule ^thread/([0-9]+)/$ comments.php?id=$1
RewriteRule ^thread/([0-9]+)/([0-9]+)$ comments.php?id=$1&page=$2
RewriteRule ^thread/([0-9]+)/([0-9]+)/$ comments.php?id=$1&page=$2

RewriteRule ^([0-9]+)$ index.php?action=displaycat&catid=$1
RewriteRule ^([0-9]+)/$ index.php?action=displaycat&catid=$1
RewriteRule ^([0-9]+)/([0-9]+)$ index.php?action=displaycat&catid=$1&page=$2
RewriteRule ^([0-9]+)/([0-9]+)/$ index.php?action=displaycat&catid=$1&page=$2

RewriteRule ^([-_/\+A-Za-z0-9]+)$ index.php?action=displaycat&catname=$1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...