mod_rewrite
Moderator: General Moderators
mod_rewrite
Man, I have played around with this thing for a couple of hours now. Apaches description seems much too complex for me to comprehend at the moment, and googling turns up specific tutorials that don't seem to match my needs. Could someone please show me how to do this:
turn
http://www.domain.com/page.php?var=something
into
http://www.domain.com/something
turn
http://www.domain.com/page.php?var=something
into
http://www.domain.com/something
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Yeah that's what I mean.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
my feeble attempt to write this myself goes as follows:
Currently this doesn't do much. It gives me a page not found error.
What I'm attempting to match is any character A-Z a-z 0-9 underscores and hyphens (max 25 characters)
Code: Select all
ReWriteEngine on
ReWriteRule ^(\w+)(/)?$ showme.php?u=$1 [R]What I'm attempting to match is any character A-Z a-z 0-9 underscores and hyphens (max 25 characters)
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
OK. So I came up with this rule (despite my many attempts for help
). I guess once you're after something, eventually you'll find the answer.
This works great. Does anyone see any problems with it? Like would a normal page ever be caught by this regex?
Code: Select all
RewriteEngine on
RewriteRule ^([a-zA-Z0-9_-]+)(/)?$ page.php?u=$1Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.