Drakim
10-02-2008, 10:30 AM
RewriteCond %{HTTP_HOST} ^blog.drakim\.net$ [NC] //check that we are on the blog.drakim domain.
RewriteCond %{QUERY_STRING} !^.+$ //check that there are no GET values in the url
RewriteRule ^(j.+)$ /index.php?GET=$1 [L] //if there was no GET value, go to index.php again, and put the requested file in a GET value
This works perfectly.
If I use the adress "blog.drakim.net/javascript", it will redirect perfectly back to the index.php, with the "javascript" string in the GET value.
However, this will only work if the keyword here starts with j
Easy as pie, we will just remove that j, right?
RewriteCond %{HTTP_HOST} ^blog.drakim\.net$ [NC]
RewriteCond %{QUERY_STRING} !^.+$
RewriteRule ^(.+)$ /index.php?GET=$1 [L]
This, however, throws great balls of error signs. This one to be more specific:
Forbidden
You don't have permission to access /site-cgi-bin/php-cgiwrap/kim/index.php on this server.
It works if I set an absolute path, but that's not what I'm trying to do here. Why is the starting directory changed? I don't understand.
RewriteCond %{QUERY_STRING} !^.+$ //check that there are no GET values in the url
RewriteRule ^(j.+)$ /index.php?GET=$1 [L] //if there was no GET value, go to index.php again, and put the requested file in a GET value
This works perfectly.
If I use the adress "blog.drakim.net/javascript", it will redirect perfectly back to the index.php, with the "javascript" string in the GET value.
However, this will only work if the keyword here starts with j
Easy as pie, we will just remove that j, right?
RewriteCond %{HTTP_HOST} ^blog.drakim\.net$ [NC]
RewriteCond %{QUERY_STRING} !^.+$
RewriteRule ^(.+)$ /index.php?GET=$1 [L]
This, however, throws great balls of error signs. This one to be more specific:
Forbidden
You don't have permission to access /site-cgi-bin/php-cgiwrap/kim/index.php on this server.
It works if I set an absolute path, but that's not what I'm trying to do here. Why is the starting directory changed? I don't understand.