Home › Forums › Other › [Solved] .htaccess mod_rewrite › Re: [Solved] .htaccess mod_rewrite
dratts… this doesn’t seem to work. Here is what I have:
RewriteEngine on
RewriteBase /about/
RedirectMatch 301 (.*).shtml http://trinityportland.org/our-school/about/$1
# END DIRECTORY REDIRECTION
Things I changed:
-
the /directory/
the domain/subdirectory/
the .html to .shtml[/list:u]
Perhaps (apologies, but hopefully) I was just errant in how I described my goal and current situation:
http://www.trinityportland.org/our-school/index.shtml
http://www.trinityportland.org/our-school/about/index.shtml[/list:u]
is the structure of my site.
The CMS (*sigh*), when encountering relative links (../about/index.shtml) is rewriting that markup as (/about/index.shtml), because it doesn’t work with subsites/sub directories and relative links. You either send it to the root with relative pathing, or you use absolute… As a stop gap, I am using absolute.
Had I stuck with relative it would send users from their intended destination, for example:
-
http://www.trinityportland.org/our-school/about/index.shtml%5B/list:u%5D
to a broken link:
-
http://www.trinityportland.org/about/index.shtml%5B/list:u%5D
So… what I need to do is redirect a user from all those folders on my site that hold content:
-
/about/
index.shtml
/assets/various media specific directories/file-name.ext
/contact/
/single/
/academics/
/admissions/
/student-life/
/alumni-parents/[/list:u]
and have them redirect to the user requested file-name.ext but at the appropriate sub-directory:
-
/our-school/about/
index.shtml
/assets/various media specific directories/file-name.ext
/our-school/contact/
/our-school/single/
/our-school/academics/
/our-school/admissions/
/our-school/student-life/
/our-school/alumni-parents/[/list:u]
This is sounding like a tall order, so even looking this concept over let alone actually providing a snippet sample that I can dupe for all the required directories would be amazing.