Skip to content

Force relative URLs #35

@GitHub-Mike

Description

@GitHub-Mike

In my example project, the values for the src and href attributes have unfortunately been assigned inconsistently. This is due to the fact that it is an older Joomla project, which has apparently undergone changes in the meantime due to plugins and components.

Here are a few examples:

 - http://example.com/images/image_1.jpg
 - https://example.com/images/image_2.jpg
 - example.com/images/image_3.jpg
 - www.example.com/images/image_4.jpg
 - /images/image_5.jpg

It affects not only images, but also regular HTML links and results in the directory structure in the target directory becoming redundant.

project_folder\index.html
project_folder\_www.example.com\index.html

Could we introduce a parameter that merges all these URLs and enforces relative paths?

--force-relative-urls

Reference should be made to the domain in the --url parameter and only apply to the following URLs:

^(https?:\/\/)?(www\.)?example\.com\/.*|^\/.*

Of course, you could also allow a regex as a parameter, but these cases should be rare:

--force-relative-urls-regex='^(https?:\/\/)?(www\.)?example\.com\/.*|^\/.*'

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions