Htaccess Redirect 500 Internal Server Error
Contents |
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 rewriteengine on 500 internal server error more about Stack Overflow the company Business Learn more about hiring developers or
Internal Server Error Htaccess Rewrite
posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community
500 Internal Server Error Wordpress
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up RewriteRule creating 500 Internal Server Error up vote 4
Internal Server Error 500
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 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 internal server error php this question asked Jun 14 '13 at 11:56 Tom 4,3042697174 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 out. Change your code to this: Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^directory/(.*)$ /directory/index.php?id=$1 [L,QSA,NC] Above code has an extra RewriteCond %{REQUEST_FILENAME} !-f that will make sure to disallow subsequent execution of RewriteRule after first time since /directory/index.php will be a valid file. share|improve this answer answered Jun 14 '13 at 12:39 an
here for a quick overview of the site Help Center how to fix 500 internal server error Detailed answers to any questions you might have Meta htaccess 500 internal server error Discuss the workings and policies of this site About Us Learn more about Stack Overflow apache error log the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question http://stackoverflow.com/questions/17107940/rewriterule-creating-500-internal-server-error x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up .htaccess file gives 500 internal server error up vote 2 down vote favorite I receive 500 internal http://stackoverflow.com/questions/21158375/htaccess-file-gives-500-internal-server-error server error on my website. I think this is because of .htaccess file, but I don't know what's wrong with it. Server: DirectAdmin, Linux-based Contents of the .htaccess file is as the following: # BEGIN All In One WP Security #AIOWPS_BLOCK_WP_FILE_ACCESS_START
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 http://webmasters.stackexchange.com/questions/24927/htaccess-mod-rewrite-500-internal-server-error site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Webmasters Questions Tags Users Badges Unanswered Ask Question _ Webmasters http://serverfault.com/questions/257845/htaccess-301-redirect-produces-500-internal-server-error 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 internal server 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 .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 internal server error 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 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.4k43279 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 Answ
Start 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 Stack Overflow the company Business Learn more about hiring developers or posting ads with us Server Fault Questions Tags Users Badges Unanswered Ask Question _ Server Fault is a question and answer site for system and network administrators. 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 301 redirect produces 500 internal server error up vote 1 down vote favorite I've added individual 301 redirect entries to .htaccess to redirect my old site's Mambo pages to the new site's Joomla pages, but the old URLs still generate 404 errors. Any ideas why? The format I used was: Redirect 301 http://www.site.com/old.htm http://www.site.com/new.htm I added these at the end of the .htaccess file. .htaccess 301-redirect joomla share|improve this question asked Apr 10 '11 at 4:18 Steve 1712314 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote accepted The Redirect directive doesn't take a full URL as the "old" location. Try: Redirect 301 /old.htm http://www.site.com/new.htm From the documentation: The old URL-path is a case-sensitive (%-decoded) path beginning with a slash. A relative path is not allowed. The new URL should be an absolute URL beginning with a scheme and hostname, but a URL-path beginning with a slash may also be used, in which case the scheme and hostname of the current server will be added. share|improve this answer answered Apr 10 '11 at 5:12 Shane Madden♦ 91.4k6107181 Yep, thanks mate, that fixed it. –Steve Apr 12 '11 at 4:23 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sig