Forum Moderators: phranque
name.cgi?mode=name
name.cgi?mode=name&id=number
and
name.cgi?item=number&type=Search
to show up as
name/mode/name
name/mode/name/id/number
and
name/item/number/type/Search
With or with out .html at the very end.
The best I can get it right now is
RewriteEngine On
RewriteBase /cgi-local/directory/
RewriteRule ^file_name.html$ file_name.cgi
turning
name.cgi?mode=name
into
name.html?mode=name
When processing a server-internal rewrite, mod_rewrite changes a requested URL into a pathname for use within the server, before your script runs.
I suspect you are trying to make your URLs more search-engine friendly. If that is the case, then it is up to your script to output search-engine friendly URLs, and you would then use mod_rewrite to translate those URLs -- when requested by the client (browser or SE 'bot) -- back into the "unfriendly" form that you need to call your script.
In case you're doing something different, here's an example for one of the rewrites you asked for:
name.cgi?item=number&type=Search -> name/item/number/type/Search
RewriteCond %{QUERY_STRING} ^([^=]+)=([^&]+)&([^=]+)=(.+)$
RewriteRule ^name\.cgi$ /name/%1/%2/%3/%4 [L]
HTH,
Jim
***************
CGIWrap encountered an error while attempting to execute this script:
Error Message: Permission denied
Error Number: 13
This message usually indicates there is a problem with the script
itself. Often this indicates either that the #! line of the script is
incorrect, or the script was uploaded in binary mode instead of ascii
mode. Check to make sure that the script does not have control-M's at
the end of every line. That will prevent it from executing. An easy
fix that takes care of this most of the time is to put '#!/.../perl
--' instead of '#!/.../perl' on the first line of the script. This is
typically a problem if the script was edited or uploaded from a
DOS/Windows/Macintosh station to a unix based server.
If you are not the owner of this script, please forward this error and
the URL that caused it to the script owner. That is often the
component in the URL right after /cgiwrap/.