mod rewrite - Only redirect the parent folder and not sub folder .htaccess -


i struggling redirect rule following scenario:

parent folder/site (landing page)

/about/leaders

sub sites (link profile)

/about/leaders/name1 /about/leaders/name2

i need deactivate /about/leaders page , redirect / but, profiles should still online.

it must similiar =

redirectmatch 301 /about/leaders/(.*) / redirectmatch 301 /about/leaders(.*) /$1 

but doesn't work. on subprofiles, part /about/leaders gets remove , /namex stays. couldn't find answer that. maybe other people achieve similiar.

anyways, glad every help

greeings jens,

think need 1 line of code

redirectmatch 301 ^/about/leaders/?$ / 

i anal using anchors. first anchor leading portion of url ^. optionally match trailing "/" ?. anchor tail end of url via $. should it. no need second directive.

since more extended urls of /about/leaders/name not match pattern, should accessible normal.

hope helps!


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -