Tag Info

New answers tagged

3

You can do this by adding another condition. RewriteCond %{REQUEST_URI} !^/members [NC] RewriteCond %{REQUEST_URI} !^/activity [NC] RewriteRule ^(.*)/([0-9]+)/$ /$1/S$2/ [R=301,L] Or, sometimes simpeler, use the OR of a regex: RewriteCond %{REQUEST_URI} !^/(members|activity) [NC] RewriteRule ^(.*)/([0-9]+)/$ /$1/S$2/ [R=301,L] I've removed the .*$ ...


3

You can just add another RewriteCond directive: RewriteCond %{REQUEST_URI} !^/activity RewriteCond %{REQUEST_URI} !^/members RewriteRule ^(.*)/([0-9]+)/$ /$1/S$2/ [R=301,L] Multiple RewriteCond directives are AND'd together by default. The OR flag can be used if required. I've removed the NC flag - unless you specifically need a case-insensitive match. As ...


1

Okay. There is a mod_dir http://httpd.apache.org/docs/2.2/mod/mod_dir.html which provides for a trailing slash redirect. You might want to enable this to make your life a lot easier. It is the module LoadModule dir_module modules/mod_dir.so in your configuration- you may need to un-comment this out. This reduces half of the work. From there, you can add the ...


0

I wasn't convinced this would work, but I've tested it and it does seem to. Quite simply: ^.{0}$ Where: ^ is the start of the match . is any character (except newline) {0} is precisely zero times $ is the end of the match


2

RewriteCond %{REQUEST_URI} !^/help/ RewriteRule (.*) /4-3/help [L,NE,R] You are getting a redirect loop here because you are saying that if the URL is not /help/ then redirect to /4-3/help (etc, etc, ...). You need to reverse the logic and only redirect when it is /help/. Change to... RewriteRule ^/?help$ /4-3/help [R,L] NB: This is a temporary (302) ...



Top 50 recent answers are included