What I think is a simple problem

New to mod_rewrite? This is a good place to start.

What I think is a simple problem

Postby ajkochanowicz » Thu Jul 23, 2009 9:54 am

I'm looking to do something very simple. I want this

http://vegan.fm/putanythinghere

to become this

http://vegan.fm/isitvegan/doku.php?do=s ... ythinghere

I got as far as creating a .htaccess file :)
ajkochanowicz
 
Posts: 4
Joined: Wed Jul 22, 2009 9:32 pm

Postby richardk » Thu Jul 23, 2009 2:23 pm

Does anything include slashes?

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

# If it's not a request to an existing file
RewriteCond %{SCRIPT_FILENAME} !-f
# and it's not a request to an existing directory
RewriteCond %{SCRIPT_FILENAME} !-d
# send the request to /isitvegan/doku.php?do=search&id=
RewriteRule ^(.+)$ /isitvegan/doku.php?do=search&id=$1 [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Holy cow

Postby ajkochanowicz » Fri Jul 24, 2009 6:43 am

WOW. That did it! It was so easy.

Thank you
thank you
thank you.

Next time you're in Omaha, I'll buy you lunch.
ajkochanowicz
 
Posts: 4
Joined: Wed Jul 22, 2009 9:32 pm


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 36 guests

cron