Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I know how to rewrite urls to redirect to a page.

When the "/" is not at the end of www.DomainName.com/user/myUserName the redirect works:

RewriteRule /$ /user/index.php

When I write RewriteBase / the above rule does not work, but a 404 error.

How to add a "/" at the end of www.DomainName.com/user/myUserName/ and still redirect to /user/index.php.

This can be written into the .htaccess or httpd.conf

Thanks Jean

share|improve this question

migrated from serverfault.com Feb 27 '11 at 19:04

This question came from our site for professional system and network administrators.

    
@johnConde I am hoping people provide an answer to my question –  Jean Feb 27 '11 at 19:17
1  
Me too. :) –  John Conde Feb 27 '11 at 19:20
    
@johnConde that would totally nullify your purpose of redirecting this question from serverfault to prowebmaster –  Jean Feb 27 '11 at 19:25
    
I didn't do it. The moderators or users of ServerFault did it. They did it because this question belongs here, not at that site. And believe it or not questions get answered here, too. ;) –  John Conde Feb 27 '11 at 19:28

2 Answers 2

Your english seems a bit confusing...

But from what I gather, the regular expression in your pattern isn't correct.

I belive you're trying to match everything to /user/index.php so try it this way:

RewriteRule /(.*)$ /user/index.php
share|improve this answer
    
That would hold good for www.MyDomainName.com/x1e, would it be good for if the domain is www.MyDomainName.com/x1e/ –  Jean Feb 28 '11 at 7:42
    
Absolutely, that catches all requests and sending them to /user/index.php –  Dani Mar 6 '11 at 12:09

The problem is that you're referring to a directory that doesn't exist. Is the .htaccess file in the root directory of you're server?

share|improve this answer

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.