Tag Info

Hot 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 ...


2

It looks like that code was developed to stop bots probing humans.txt via query strings. Not Blocked: http://example.com/humans.txt Blocked: http://example.com/?some_path=http://www.google.com/humans.txt? There is plenty of online guides about blocking humans.txt additionally lots of websites explaining what does what, a lot of those rules in that block ...


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 ...


1

about the images and CSS not displaying; If your URL gets rewritten to something like products/31 keep in mind that relative links inside the html are now relative to products/ even though the php script itself sits in the root. Because the html gets interpreted by the browser and the browser thinks you are in the products/ folder. You can use absolute urls ...



Only top voted, non community-wiki answers of a minimum length are eligible