JCats
JCats

Reputation: 141

htaccess remove 2 sublinks from URL

Example:

Redirect

http://domain.com/portfolio/items/wearable-hydration-monitor 

To

http://domain.com/wearable-hydration-monitor

The 2 subfolders will always be the same, /portfolio/items/

the variable would be wearable-hydration-monitor

I'm not sure why this wouldn't work:

RewriteEngine On
RewriteRule ^/portfolio/items/(.*)$ http://domain.com/$1 [L,R=301]

Upvotes: 1

Views: 52

Answers (1)

JCats
JCats

Reputation: 141

Figured it out :)

RedirectMatch 301 /portfolio/items/(.*)$ http://domain.com/$1

Upvotes: 1

Related Questions