mkurl

create or modify a URL based on its component parts 

Command


SYNOPSIS

mkurl [-s scheme] [-h host] [-p port] [-U username] [-P password] [-u urlpath] [-x extra] [-r rooturl] [file ...]


DESCRIPTION

The mkurl command creates a URL from various parts. In general, each option specifies a part of the URL to be created. Any file arguments are appended to the end of the URL in the order specified.

Options

-h host 

specifies the host name. For example, if you specify

mkurl -h www.mks.com

mkurl returns

http://www.mks.com
-P password 

specifies the password authorization that is encoded in the URL.

-p port 

specifies the port number.

-r rooturl 

specifies a root URL that the other options modify.

-s scheme 

specifies the scheme. For example, if you specify

mkurl -s http -h www.mks.com

mkurl returns

http://www.mks.com

If this option is not specified, mkurl uses a scheme of http.

-U username 

specifies the user authorization that is encoded in the URL.

-u urlpath 

specifies the URL path name. When a root URL is supplied by the -r option, mkurl attempts to attach the specified urlpath in the best possible manner, based on the first character of the URL path passed. mkurl treats urlpath as relative path to to the root URL.

For example, the following mkurl commands

mkurl -r http://www.mks.com/some/path/ -u more/stuff
mkurl -r http://www.mks.com/some/path/ -u /root/path
mkurl -r http://www.mks.com/some/path/ -u ../other
mkurl -r http://www.mks.com/some/path/ -u ./added

return the following URLs:

http://www.mks.com/some/path/more/stuff
http://www.mks.com/root/path
http://www.mks.com/some/other
http://www.mks.com/some/path/added
-x extra 

specifies everything after and including a ? or # in the URL. For example,

mkurl -x ?foo -h www.mks.com

returns

http://www.mks.com?foo


EXAMPLES

The following command creates a URL from scratch:

mkurl -h www.mks.com -u some/path  index.html

It returns

http://www.mks.com/some/path/index.html

You can also create a URL by specifying an existing URL with the -r option and then using the other options to modify its various parts. The command

mkurl -r http://www.mks.com/some/path/ -h intra.mks.com

returns

http://intra.mks.com/some/path/

DIAGNOSTICS

Possible exit status values are:

0 

Successful completion.

1 

A system error occurred.

2 

A usage error occurred.


PORTABILITY

Windows 10. Windows Server 2016. Windows Server 2019. Windows 11. Windows Server 2022. Windows Server 2025.


AVAILABILITY

PTC MKS Toolkit for Developers
PTC MKS Toolkit for Interoperability
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Commands:
htsplit, url, web


PTC MKS Toolkit 10.5 Documentation Build 40.