Jump to content

Is it possible to achieve with mod_rewrite...


quickstopman

Recommended Posts

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

 

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

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.