Masca Posted July 27, 2007 Share Posted July 27, 2007 Hi! Please help! I have two odd problems with my RewriteRules which I just do not seem to be able to resolve: PROBLEM 1: I want to add a trailing slash to a url such as test/1234 (therefore rewriting it to test/1234/). My RewriteRule rule is: RewriteRule ^(.*)([0-9]{4})$ $1$2/ [R] but, the last slash in the rule is currently being ignored. However, the following: RewriteRule ^(.*)([0-9]{4})$ $1$2// [R] results in test/1234// using the above exmaple. Why is this? PROBLEM 2: Why does (a) below work, but (b) below not work? I would like to use (b). (a) RewriteRule ^foo-bar/([A-Za-z]+)/$ foobar.php?type=$1 [L] - working (b) RewriteRule ^foobar/([A-Za-z]+)/$ foobar.php?type=$1 [L] - not working The only difference is the hyphen in (a). TIA Quote Link to comment Share on other sites More sharing options...
hackerkts Posted July 28, 2007 Share Posted July 28, 2007 It would be a better idea if you provide your dynamic URL and static URL you want it to be. RewriteRule ^([a-zA-Z]+)/([0-9]+){4}/$ NYNAMIC-URL For (a), it will work only if you goes to http://domain.tld/foo-bar/ASDAS/ as for (b), it's http://domain.tld/foobar/ASDASD/ Take note of the "-". Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.