Forum Moderators: phranque

Message Too Old, No Replies

Everything but /

         

Murf

8:10 pm on Jun 22, 2005 (gmt 0)

10+ Year Member



Hi all,

i'm trying to use .htaccess to change those stupid url's into nice ones ;)

But there is one problem.

RewriteEngine On
RewriteRule leden/([^.]+)$/?pagina=login/$1

RewriteRule ^([^\.\?/]+)/wijzigen/([^\.\?/]+)/([^\.\?/]+)$/?pagina=$1/wijzigen&id=$2&edit=$3
RewriteRule ^([^\.\?/]+])/([^\.\?/]+)/([^\.\?/]+)$ /?pagina=$1/$1&cat=$2&id=$3
RewriteRule ^([^\.\?/]+)/([^\.\?/]+)$ /?pagina=$1/$1&cat=$2
RewriteRule ^([^\.\?/]+)$ /?pagina=$1/$1

If you have for example
[website...]
i get an error 404 because window.close() isn't a file (of course not)

So can anyone help me to accept everything but /?
(so you can have /something-else/some.thing/

Edit: I think it has to be something like this but i get an error 500

RewriteEngine On
RewriteRule leden/([^.]+)$/?pagina=login/$1
RewriteRule ^([^/]*)/wijzigen/([^/]*)/([^/]*)$/?pagina=$1/wijzigen&id=$2&edit=$3
RewriteRule ^([^/]*])/([^/]*)/([^/]*)$ /?pagina=$1/$1&cat=$2&id=$3
RewriteRule ^([^/]*)/([^/]*)$/?pagina=$1/$1&cat=$2
RewriteRule ^([^/]*)$/?pagina=$1/$1

jd01

9:48 pm on Jun 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Murf,

Apache does not 'see' the ? in a URL as a character that can be matched. ? to Apache 'says' everything after this is a QUERY_STRING, so the only way to 'match' information after a ? in a URL is through a RewriteCond %{QUERY_STRING}

You might look into the use of this condition: try using a major SE and 'query string site:webmasterworld.com'

Please, also post an examplified version of the URL(s) you are trying to rewrite, and where you would like to serve the information from when your are done... some of are very visual and cannot offer meaningful advice if we cannot 'see' how things are working and how you would like them to work.

Justin