apache doesn't accept this htaccess rewrite rule [duplicate]












0
















This question already has an answer here:




  • RewriteRule creating 500 Internal Server Error

    4 answers



  • Internal server error With RewriteRule

    1 answer



  • RewriteRule Last [L] flag not working?

    2 answers




For some reason Apache is throwing an error if I use this rewrite rule in my .htaccess file



RewriteRule ^(.*)$ /controller.php?lang=en&page=$1 [NE,QSA,L]


What I want to achieve is the following:
If the user hits



https://www.mywebsite.com/whatever


I want to call



https://www.mywebsite.com/controller.php?lang=en&page=whatever


Here's the error I get:




Internal Server Error



The server encountered an internal error or misconfiguration and was
unable to complete your request.



Please contact the server administrator at webmaster@mywebsite.com
to inform them of the time this error occurred, and the actions you
performed just before this error.



More information about this error may be available in the server error
log.



Additionally, a 500 Internal Server Error error was encountered while
trying to use an ErrorDocument to handle the request.











share|improve this question













marked as duplicate by mario php
Users with the  php badge can single-handedly close php questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 21 '18 at 17:58


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















  • Look into the error.log for details. Possibly enable the rewrite log as well. Also this rule is too generic and going to recurse.

    – mario
    Nov 21 '18 at 17:57











  • ok found the problem, the rewritten url was matching again the rule causing an infinite loop

    – Gianluca Ghettini
    Nov 21 '18 at 18:03











  • Either strip the leading target / or use the [END] flag. Better yet use something more fitting than (.*), such as w+

    – mario
    Nov 21 '18 at 18:04


















0
















This question already has an answer here:




  • RewriteRule creating 500 Internal Server Error

    4 answers



  • Internal server error With RewriteRule

    1 answer



  • RewriteRule Last [L] flag not working?

    2 answers




For some reason Apache is throwing an error if I use this rewrite rule in my .htaccess file



RewriteRule ^(.*)$ /controller.php?lang=en&page=$1 [NE,QSA,L]


What I want to achieve is the following:
If the user hits



https://www.mywebsite.com/whatever


I want to call



https://www.mywebsite.com/controller.php?lang=en&page=whatever


Here's the error I get:




Internal Server Error



The server encountered an internal error or misconfiguration and was
unable to complete your request.



Please contact the server administrator at webmaster@mywebsite.com
to inform them of the time this error occurred, and the actions you
performed just before this error.



More information about this error may be available in the server error
log.



Additionally, a 500 Internal Server Error error was encountered while
trying to use an ErrorDocument to handle the request.











share|improve this question













marked as duplicate by mario php
Users with the  php badge can single-handedly close php questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 21 '18 at 17:58


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















  • Look into the error.log for details. Possibly enable the rewrite log as well. Also this rule is too generic and going to recurse.

    – mario
    Nov 21 '18 at 17:57











  • ok found the problem, the rewritten url was matching again the rule causing an infinite loop

    – Gianluca Ghettini
    Nov 21 '18 at 18:03











  • Either strip the leading target / or use the [END] flag. Better yet use something more fitting than (.*), such as w+

    – mario
    Nov 21 '18 at 18:04
















0












0








0









This question already has an answer here:




  • RewriteRule creating 500 Internal Server Error

    4 answers



  • Internal server error With RewriteRule

    1 answer



  • RewriteRule Last [L] flag not working?

    2 answers




For some reason Apache is throwing an error if I use this rewrite rule in my .htaccess file



RewriteRule ^(.*)$ /controller.php?lang=en&page=$1 [NE,QSA,L]


What I want to achieve is the following:
If the user hits



https://www.mywebsite.com/whatever


I want to call



https://www.mywebsite.com/controller.php?lang=en&page=whatever


Here's the error I get:




Internal Server Error



The server encountered an internal error or misconfiguration and was
unable to complete your request.



Please contact the server administrator at webmaster@mywebsite.com
to inform them of the time this error occurred, and the actions you
performed just before this error.



More information about this error may be available in the server error
log.



Additionally, a 500 Internal Server Error error was encountered while
trying to use an ErrorDocument to handle the request.











share|improve this question















This question already has an answer here:




  • RewriteRule creating 500 Internal Server Error

    4 answers



  • Internal server error With RewriteRule

    1 answer



  • RewriteRule Last [L] flag not working?

    2 answers




For some reason Apache is throwing an error if I use this rewrite rule in my .htaccess file



RewriteRule ^(.*)$ /controller.php?lang=en&page=$1 [NE,QSA,L]


What I want to achieve is the following:
If the user hits



https://www.mywebsite.com/whatever


I want to call



https://www.mywebsite.com/controller.php?lang=en&page=whatever


Here's the error I get:




Internal Server Error



The server encountered an internal error or misconfiguration and was
unable to complete your request.



Please contact the server administrator at webmaster@mywebsite.com
to inform them of the time this error occurred, and the actions you
performed just before this error.



More information about this error may be available in the server error
log.



Additionally, a 500 Internal Server Error error was encountered while
trying to use an ErrorDocument to handle the request.






This question already has an answer here:




  • RewriteRule creating 500 Internal Server Error

    4 answers



  • Internal server error With RewriteRule

    1 answer



  • RewriteRule Last [L] flag not working?

    2 answers








php apache .htaccess mod-rewrite






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 21 '18 at 17:52









Gianluca GhettiniGianluca Ghettini

5,51164386




5,51164386




marked as duplicate by mario php
Users with the  php badge can single-handedly close php questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 21 '18 at 17:58


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by mario php
Users with the  php badge can single-handedly close php questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 21 '18 at 17:58


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • Look into the error.log for details. Possibly enable the rewrite log as well. Also this rule is too generic and going to recurse.

    – mario
    Nov 21 '18 at 17:57











  • ok found the problem, the rewritten url was matching again the rule causing an infinite loop

    – Gianluca Ghettini
    Nov 21 '18 at 18:03











  • Either strip the leading target / or use the [END] flag. Better yet use something more fitting than (.*), such as w+

    – mario
    Nov 21 '18 at 18:04





















  • Look into the error.log for details. Possibly enable the rewrite log as well. Also this rule is too generic and going to recurse.

    – mario
    Nov 21 '18 at 17:57











  • ok found the problem, the rewritten url was matching again the rule causing an infinite loop

    – Gianluca Ghettini
    Nov 21 '18 at 18:03











  • Either strip the leading target / or use the [END] flag. Better yet use something more fitting than (.*), such as w+

    – mario
    Nov 21 '18 at 18:04



















Look into the error.log for details. Possibly enable the rewrite log as well. Also this rule is too generic and going to recurse.

– mario
Nov 21 '18 at 17:57





Look into the error.log for details. Possibly enable the rewrite log as well. Also this rule is too generic and going to recurse.

– mario
Nov 21 '18 at 17:57













ok found the problem, the rewritten url was matching again the rule causing an infinite loop

– Gianluca Ghettini
Nov 21 '18 at 18:03





ok found the problem, the rewritten url was matching again the rule causing an infinite loop

– Gianluca Ghettini
Nov 21 '18 at 18:03













Either strip the leading target / or use the [END] flag. Better yet use something more fitting than (.*), such as w+

– mario
Nov 21 '18 at 18:04







Either strip the leading target / or use the [END] flag. Better yet use something more fitting than (.*), such as w+

– mario
Nov 21 '18 at 18:04














0






active

oldest

votes

















0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Guess what letter conforming each word

Port of Spain

Run scheduled task as local user group (not BUILTIN)