Giter Club home page Giter Club logo

rewriterule-generator's Introduction

Mod Rewrite Rule Generator

CI Latest Stable Version License

Web Frontend: https://donatstudios.com/RewriteRule_Generator

What it is

  • A simple builder of RewriteCond / RewriteRule's handling GET strings in any order.
  • Free and open source

What it is not

  • Perfect

Todo:

  • Nginx Option
    • This is proving to be more difficult than initially anticipated. Handling the GET parameters in any order may require the use of if statements which is frowned upon in the Nginx community and has performance overheads.

rewriterule-generator's People

Contributors

dependabot[bot] avatar donatj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rewriterule-generator's Issues

Comments checkbox not working

Hi there,

With the recent changes, it's not possible anymore to disable comments.
When unchecking and submitting, the checkbox will be rechecked and comments will still be rendered.

This has been tested on Safari & Chrome.

Conditional rules after a generic rule

Hi Donatj,

thanks for your redirect script.
I tried to use it to redirects over 300 links.
But i have a problem i have differenti type of links:

old /it/notizie/2026-a-title-for-thenews.html new https://www.mywebsite.it/notizie/2019/notizia/a-title-for-thenews old /it/notizie/2025-s-second-title.html | new https://www.mywebsite.it/notizie/2019/notizia/a-second-title

In this first case the script create generic Rewrite rule one for each single link as:

RewriteRule ^it/notizie/2026-a-title-for-thenews.html https://www.mywebsite.it/notizie/2019/notizia/a-title-for-thenews? [R=301,L]

And it's perfect. I made a collctnio of this 300 links, insert it in a rewritemap file and recal it to my.htaccess

Then i'd like to create other rules that could be applied if the all the first links of links are not recalled fro ma server request

So
I'd like generic:

https://www.mywebsite.it/tags/tag/allthelinks after that could be redirect to https://www.mywebsite.it

And

then insert a rule like this:
RedirectMatch 301 ^/it(.*)$ https://www.mywebsite.it$1

That is all the files who are not inserted in the reidrect match generated weith scripts genrically have to redirect to the home page. I don't know if is a order problem or something else but this rules don't work for me. Tried to insert into the script but i understand the script can't manage all cases.

Have you some suggestions?

Thanks!

hash part # (anchor) on destination will be removed

If I use the following input for the generator

http://domain1.com/test123 https://www.domain2.com/test#bla

it will output

// # 301 --- http://domain1.com/test123 => https://www.domain2.com/test#bla
RewriteCond %{HTTP_HOST} ^domain1.com$
RewriteRule ^test123$ https://www.domain2.com/test? [L,R=301]

The hash # on the destination is lost.

The correct output for this case should be:

RewriteCond %{HTTP_HOST} ^domain1.com$
RewriteRule ^test123$ https://www.domain2.com/test#bla [L,R=301,NE]

So # and NE|noescape rewrite rule flag.

Is this correct ?
Can you implement this special case ?

Thanks!

Question mark at the end

This may not be an issue but for some reason, the rewrite has a question mark at the end of the new url. For example, if I use the following as the input:
/old/url/ /new-url/

I get the following as output

# 301 --- /old/url/ => /new-url/
RewriteRule ^old/url/$ /new-url/? [L,R=301]

This works but I don't know what the ? is for after /new-url/?

I have never seen any documentation for this and am not sure if it is a bug or if it is there for a reason.

[Bug] Canonical domain check with functional domain names

input: domain.com.pl

output:

http://com.pl
https://com.pl
http://www.com.pl
https://www.com.pl

expected output:

http://domain.com.pl
https://domain.com.pl
http://www.domain.com.pl
https://www.domain.com.pl

I think it's self-explaining.

leading / is removed

I tried to generate the RewriteRule for this mapping

/products /popcorn-products

The

RewriteRule ^products$ /popcorn-products? [L,R=301]

It is missing the / after ^.

HTTP -> HTTPS

should provide http -> https rewrite cond if these mismatch

input:
http://example.org/example-path/ https://example.org/example-path/

current output:
RewriteRule ^example\-path/$ /example\-path/? [L,R=301]

expected output:

RewriteCond %{HTTPS} !=on
RewriteRule ^example\-path/$ https://example.org/example\-path/? [L,R=301]

Maybe it should be as opt-in feature for the RewriteCond part, but the expected output RewriteRule definitely requires fix

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.