htaccess ReWrite question

Permalink
Hi all,

How can I rewrite the path by removing one element from the full path. What do I need to write in my .htaccess to make this work?

Example (removing "subdir/" in the following example):
From: www.yourwebsite.com/subdir/page/subpage/
To: www.yourwebsite.com/page/subpage/


Thank you for the help

olacom
 
jordanlev replied on at Permalink Reply
jordanlev
Something along the lines of:
RewriteRule www\.yourwebsite\.com\/([^/]+)\/subpage/(.*) www\.yourwbsite\.com\/page\/subpage/$2

I'm not sure if that works, though -- you're going to want to learn a little bit more about how rewrite rules work in general. Google "htaccess mod_rewrite redirect" -- there are tons of tutorials about how to do this.

Good luck!

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.