15

Anybody know an online tool to generate Apache mod_rewrite rules to point people with simple .htaccess questions to?

I'm thinking of simple standard scenarios:

  • Simple redirects (url1=>url2)

  • Removing / adding www.

  • /a/b/c/d to index.php?value1=a&value2=b...

and so on and so on....

I'm asking because most mod_rewrite questions turning up on SO could be answered with a link to that, and help people help themselves (well, help as far as "help" goes with a generator tool that can be used without actually having to learn how things work.)

Pekka
  • 442,112
  • 142
  • 972
  • 1,088
  • On a semi-related note, I'm working on something in response to [this question](http://stackoverflow.com/questions/3417039/a-tool-to-debug-and-test-mod-rewrite-htaccess-directives)...but shh, it's a secret (actually I just got lazy/busy and need to get back to working on it). Also, you reminded me that I should take a stab at writing the `mod_rewrite` tag wiki... – Tim Stone Sep 12 '10 at 19:24
  • @Tim nice, feel free to add if something comes out of it! That sounds interesting. – Pekka Sep 12 '10 at 19:26
  • @Pekka웃, I know this is old, but it is generating activity (with link answers) and it off-topic for new standards of SO, I will close vote it please tell me if you think you can get it on-topic or that I'm wrong so I can retract my vote. – Petter Friberg Mar 10 '16 at 22:32
  • 1
    @Petter it's definitely off topic by today's standards; no point trying to change that, IMO. – Pekka Mar 10 '16 at 22:44
  • May be https://htaccess.xyz ? – Amit Verma Apr 14 '21 at 05:48

2 Answers2

10

Even more such questions could be solved with a link to the manual.

If we provide only a link to a generator, the answer has no educational value, and will result only in more trivial questions asked. I'd recommend reading answers to this question form meta, which contains some relevant discussion.

That said, a quick google search has returned some useful results:

Community
  • 1
  • 1
Mewp
  • 4,715
  • 1
  • 21
  • 24
  • 1
    +1 both nice! Re the 2nd paragraph: I doubt the influx of trivial questions can be stopped either way. (I have asked a related question on [Meta](http://meta.stackexchange.com/questions/62258/what-can-be-done-about-repetitive-questions)) I'm rather looking for a lazy way to give a useful answer. The manual is too complex for people who know nothing about Apache; your tutorial link looks interesting, though. – Pekka Sep 12 '10 at 13:21
  • @Pekka: There will always be new users who will ask trivial questions, but I think that it's important to teach them to try and learn themselves, so they won't do it again (and become better programmers along the way). – Mewp Sep 12 '10 at 13:41
5

A cheap google search has two that exist.

I've tried three so far. I like this one the most so far:

Also, if you need a tool to test these results:

Eugene Mayevski 'Callback
  • 45,135
  • 8
  • 71
  • 121
chrisjlee
  • 21,691
  • 27
  • 82
  • 112