Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need quick help with rewrite issue...new to htaccess rules...

Status
Not open for further replies.

spewn

Programmer
May 7, 2001
1,034
hello!

i am using this:

Code:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^ad/(.*)$ get.cgi?ad=$1

which works fine when my url looks like this:


however, i want to remove the /ad part, and just have:


i tried a couple ideas, but haven't got it, and i'm sure it's something simple. unfortunately, this is my first time manipulating htaccess file.

any help?

thanks!

- g
 
Do this:

Code:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REUQEST_FILENAME} !-d
RewriteRule . /something.cgi [L]

Inside of /something.cgi, use $ENV{REQUEST_URI} to get the actual request (eg "/1548").

The conditions here will only do the rewrite if their request filename is not a file or a directory.

-------------
Cuvou.com | My personal homepage
Code:
perl -e '$|=$i=1;print" oo\n<|>\n_|_";x:sleep$|;print"\b",$i++%2?"/":"_";goto x;'
 
thanks.

i actually just came up with this:

Code:
RewriteRule ^([0-9]+)$ get.cgi?ad=$1

works. will i encounter problems?

thanks again!

- g
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top