quickstopman Posted April 2, 2008 Share Posted April 2, 2008 is it possible to achieve something like this instead of action.php?action=signup you could do action:signup since im not that good with RewriteRule i tried this (it didn't work) RewriteRule /action:([a-z]) /action.php?action=$1 and if it is possible could you show me how? Thanks, Zack Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted April 2, 2008 Share Posted April 2, 2008 You cannot use special characters such as colons as part of a url path. You can have your url as /action/signup or just /signup RewriteBase / RewriteRule ^action/([a-z]+)$ /test.php?action=$1 [NC,L] # eg: action/signup RewriteRule ^([a-z]+)$ /test.php?action=$1 [NC,L] # eg: /signup Quote Link to comment Share on other sites More sharing options...
quickstopman Posted April 2, 2008 Author Share Posted April 2, 2008 the confusing part is that ive seen it done before on a little video site called vimeo when you view a blog the url is like http://www.vimeo.com/blog:122 122 being the ID is that being done inside the script where it takes apart the url and singles out the 122 and go through the database to find the ID would that be PHP or some other odd language Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted April 3, 2008 Share Posted April 3, 2008 I have done a bit of googling and this is an issue to do with libapr when Apache is installed on Windows. Due to Windows not allowing characters such as colons within file names libapr is not allowing the requested url. However strangely enough if your url is say - mysite.com/foo/bar:test - then it'll work fine. Whether a fix is going to be released or not in the next/future versions of Apache for Windows I don't know. This only affects Apache installations on Windows. Quote Link to comment Share on other sites More sharing options...
quickstopman Posted April 3, 2008 Author Share Posted April 3, 2008 hmm, well my server is a linux, so it should work then! right? my question is how would the code look.. ??? -Zack Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted April 3, 2008 Share Posted April 3, 2008 If Apache is installed on a Linux server then the following should work: RewriteRule ^action:([a-z]+)$ /action.php?action=$1 [NC,L] Quote Link to comment Share on other sites More sharing options...
quickstopman Posted April 3, 2008 Author Share Posted April 3, 2008 Yes that works!!! thanks alot wildteen!! -Zack 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.