GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   htaccess rewrite rule help needed. (https://gfy.com/showthread.php?t=1050583)

cooldude7 12-19-2011 11:21 PM

htaccess rewrite rule help needed.
 
these both giving me 500 error

RewriteRule ^(.*)$ /search.php?s=$1 [L]



RewriteRule ^([^/]*)$ /search.php?s=$1 [L]

can anybody help. ?

what i wanted to do is

domain.com/anything to go to domain.com/search.php?s=anything

thanks

cooldude7 12-19-2011 11:32 PM

i tried this

RewriteEngine On

<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /search.php?s=$1 [L]
</IfModule>


but if i access

domain.com/somefile.php

it goes to search.,., wtf

RonTheDon 12-19-2011 11:38 PM

See what this does:

ReWriteRule ^(.*)$ search.php?search.php?s=$1


Notice the removal of '/' from the beginning of search.php

If anything, ping me on ICQ and I'll try and help further.

leg4 12-20-2011 02:10 AM

Any luck? did you get it working?

cooldude7 12-20-2011 02:59 AM

Quote:

Originally Posted by leg4 (Post 18641302)
Any luck? did you get it working?

nope., something is missing there.,

and even the script is encrypted.,.,

redwhiteandblue 12-20-2011 05:23 AM

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) search.php?s=$1

is mine.

fris 12-20-2011 06:59 AM

Quote:

Originally Posted by cooldude7 (Post 18641105)
these both giving me 500 error

RewriteRule ^(.*)$ /search.php?s=$1 [L]



RewriteRule ^([^/]*)$ /search.php?s=$1 [L]

can anybody help. ?

what i wanted to do is

domain.com/anything to go to domain.com/search.php?s=anything

thanks

bad idea.

raymor 12-20-2011 08:55 AM

Quote:

Originally Posted by cooldude7 (Post 18641105)
these both giving me 500 error

RewriteRule ^(.*)$ /search.php?s=$1 [L]



RewriteRule ^([^/]*)$ /search.php?s=$1 [L]

can anybody help. ?

what i wanted to do is

domain.com/anything to go to domain.com/search.php?s=anything

thanks

Either of those lines alone will give you a 500 error.
You definitely need either:
RewriteCond %{REQUEST_FILENAME} !-f

or:

RewriteCond !search.php

Without either, /Ray redirects to search.php?Ray
search.php?Ray redirects to search.php?search.php
search.php?search.php redirects again to search.php?search.php
round and round in a circle

cooldude7 12-20-2011 09:56 AM

Quote:

Originally Posted by redwhiteandblue (Post 18641589)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) search.php?s=$1

is mine.


okie.,

Quote:

Originally Posted by fris (Post 18641776)
bad idea.

roger that., i left it as it is.,

Quote:

Originally Posted by raymor (Post 18642018)
Either of those lines alone will give you a 500 error.
You definitely need either:
RewriteCond %{REQUEST_FILENAME} !-f

or:

RewriteCond !search.php

Without either, /Ray redirects to search.php?Ray
search.php?Ray redirects to search.php?search.php
search.php?search.php redirects again to search.php?search.php
round and round in a circle

RewriteCond %{REQUEST_FILENAME} !-f

gives lots of errors.

RewriteCond !search.php

gives 500

thanks for your time.,

fris 12-20-2011 10:28 AM

Quote:

Originally Posted by cooldude7 (Post 18642133)
okie.,



roger that., i left it as it is.,



RewriteCond %{REQUEST_FILENAME} !-f

gives lots of errors.

RewriteCond !search.php

gives 500

thanks for your time.,

is this a wp site?

maybe this will interest you, i did this for someone a while back, they wanted

Code:

domain.com/search/search-term.html
Code:

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^search/(.+)\.html$ /index.php?s=$1 [QSA,L]

not sure if this will help you


All times are GMT -7. The time now is 06:48 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123