oshaman
oshaman

Reputation: 3

htaccess Redirect 301

I'm trying to do a simple 301 redirect

From

http://my-site.com/old-cat/old-sub-cat/ARTICLE_NAME

.htaccess

RewriteCond %{REQUEST_URI} ^/old-cat/old-sub-cat/(.*)$

RewriteRule ^(.*)$ /new-cat/%1 [R=301,L]

But as a result I get a new category without a slash

http://my-site.com/new-catARTICLE_NAME

where I made a mistake?

Upvotes: 0

Views: 98

Answers (1)

Webdesigner
Webdesigner

Reputation: 1982

This should also work for you, you do not need a RewriteCond at all:

RewriteRule ^/?old-cat/old-sub-cat/(.*)$ /new-cat/$1 [R=301,L]

But your code is also right.

Browser tend to remember 301 redirects so it could be that this is not coming from your Server at all but from your Browser

It could also be that some other .htaccess maybe in some other directory or the Server configuration or the APP itself do some redirect.

Upvotes: 0

Related Questions