Apache Redirect Internal Server Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta htaccess redirect internal server error Discuss the workings and policies of this site About Us Learn more apache internal server error log about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack
Apache Internal Server Error Php
Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping
Internal Server Error Apache Server At Port 80
each other. Join them; it only takes a minute: Sign up RewriteRule creating 500 Internal Server Error up vote 4 down vote favorite I have the following in my .htaccess file: Options +FollowSymLinks RewriteEngine on RewriteRule ^directory/(.*)$ directory/index.php?id=$1 What I'm trying to achieve is this: When the URL www.mydomain.com/directory/10 is visited, the page www.mydomain.com/directory/?id=10 is displayed on internal server error apache virtual host the browser without altering the appearance of the URL. The above code creates a 500 Internal server error though. Does anyone know where I'm going wrong? php apache .htaccess mod-rewrite share|improve this question asked Jun 14 '13 at 11:56 Tom 4,2692595174 1 A 500 error generally means an error has been logged somewhere. Find your Apache and PHP error logs, and see what the actual error is. –IMSoP Jun 14 '13 at 11:58 4 The 500 error delivered to the browser should have informed you that the full error message would be in the server logs. Read them. –Quentin Jun 14 '13 at 11:58 add a comment| 4 Answers 4 active oldest votes up vote 9 down vote accepted Your code is guaranteed to generate 500 internal server error because it is causing infinite looping. Reason is that your matching URI pattern is: ^directory/(.*)$ Which matches your URLs before and after rewrites. And once it reaches max allowed internal rewrite limit Apache throws 500 internal server error and bails
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about
Internal Server Error Apache Ubuntu
Stack Overflow the company Business Learn more about hiring developers or posting ads with apache 500 internal server error us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is apache 500 internal server error no log a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Redirect to external site on 500 error with .htaccess up vote 1 down vote http://stackoverflow.com/questions/17107940/rewriterule-creating-500-internal-server-error favorite I am working on a website (scratchyone.com). I need to have my .htaccess redirect to an external page http://scratchywon.github.io/scratchyone.com/errors/500.html on a 500 error. I am forcing a 500 with php. http://scratchyone.com/500/ Here is my current code: ErrorDocument 500 http://scratchywon.github.io/scratchyone.com/errors/500.html EDIT: ErrorDocument 404 http://scratchywon.github.io/scratchyone.com/errors/500.html works Now that I am using php to send the 500 error, the page doesn't display. It just displays the browser's default "500: Could not display" apache http://stackoverflow.com/questions/34377547/redirect-to-external-site-on-500-error-with-htaccess .htaccess redirect share|improve this question edited Jan 15 at 21:28 asked Dec 20 '15 at 2:56 Scratchywon 164 What is the problem with your error document? –starkeen Dec 20 '15 at 3:08 it's really hard to determine what would be wrong without a more complete .htaccess post, without knowing your server environment and without posting any errors you may be getting either on your browser or in your httpd logs.. update your question with more details. –tremor Dec 20 '15 at 3:15 It is giving the default 500 error message. –Scratchywon Dec 20 '15 at 4:12 Your .htaccess might not be enabled –anubhava Dec 20 '15 at 4:19 No, because it works for 404 error pages. –Scratchywon Dec 20 '15 at 5:12 | show 1 more comment 1 Answer 1 active oldest votes up vote 1 down vote accepted Internal error in .htaccess not relay custom ErrorDocument (!) and simulate 500 error via PHP is not quite possible - when your script run it's too late - error document redirection is handled by apache mod_core (!) and PHP only send status. So I think you can forget about PHP 500-simulation. Try to make a directory next to main .htacces
for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about http://webmasters.stackexchange.com/questions/24927/htaccess-mod-rewrite-500-internal-server-error hiring developers or posting ads with us Webmasters Questions Tags Users Badges Unanswered Ask Question _ Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top .htaccess mod_rewrite 500 internal server error up vote 2 down vote favorite Whenever I place my internal server .htaccess file in my web directory I receive a 500 internal server error and within the error.log file specifying: [Sat Jan 21 13:46:07 2012] [error] [client xx.xx.xxx.xx] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. My .htaccess file: RewriteEngine On RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !(\.png|\.jpg|\.gif|\.jpeg|\.bmp|\.css|\.js)$ RewriteRule ^(.*) index.php I have tried enabling Options +FollowSymLinks but this has been internal server error fruitless. Everything works locally. Any pointers as to what I could be doing wrong? php htaccess mod-rewrite http-code-500 error-reporting share|improve this question edited Mar 8 '13 at 12:28 Simon Hayter♦ 21.2k43279 asked Jan 21 '12 at 13:04 Bart Zweers migrated from stackoverflow.com Jan 23 '12 at 3:38 This question came from our site for professional and enthusiast programmers. You can't use two %{} parameters in a single RewriteCond.. use REQUEST_URI for your rule above –yoavmatchulsky Jan 21 '12 at 13:24 2 this is not true, you can use multiple %{} parameters, this will look for the regex in the concatenated string –Yaron Uliel Jan 21 '12 at 13:28 @YaronUliel that's a first for me. thanks :) –yoavmatchulsky Jan 21 '12 at 13:34 1 @yoavmatchulsky בכיף :) –Yaron Uliel Jan 21 '12 at 13:39 add a comment| 3 Answers 3 active oldest votes up vote 1 down vote accepted Change your code with this: Options +FollowSymLinks -MultiViews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule . index.php [L] share|improve this answer answered Jan 21 '12 at 13:22 anubhava 38825 That will check if the URL doesn't exists.. that's not what he asked for.. –yoavmatchulsky Jan 21 '12 at 13:25 also, if you want to check the -f flag, you need to check it against the full path of the file