Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Can somebody help me with a mod_rewrite rule for this situation? I only need to remove the ‘s’ from a forums segment.

From

 www.test.com/test-forums/anystring/anystring

or

test.com/test-forums/anystring/anystring

To

/test-forum/anystring/anystring 

So to speak, only S at the end of "forums" is removed.

Any help would be great. Cheers

share|improve this question

1 Answer 1

You can try this in your VirtualHost:80 section:

<VirtualHost *:80>
  ... other configuration ...

  RewriteEngine On
  RewriteRule ^/test-forums(.*) /test-forum$1
</VirtualHost>

This will leave the url in the browser address bar as www.test.com/test-forums/anystring/anystring

If you want to send a redirect to the browser so the url displayed in the address bar becomes www.test.com/test-forum/anystring/anystring, add [L,R=301] to the RewriteRule line:

RewriteRule ^/test-forums(.*) /test-forum$1 [L,R=301]
share|improve this answer
    
Thanks a lot. It helped me. –  Oleg Videnov Aug 24 '12 at 21:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.