301 Redirect Causes 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
Htaccess 301 Redirect 500 Internal Server Error
About Us Learn more about Stack Overflow the company Business Learn more iis redirect 500 internal server error about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss
Internal Server Error Cgi
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 Redirect 301 in htaccess redirect 500 internal server error .htaccess causes 500 server error (Redirect to non-URL) up vote 6 down vote favorite 1 have such kind of error. When adding Redirect 301 rule to .htaccess file like: Redirect 301 "/page1.html" "/dir1/" My site fails with 500 server error and in apache error log this error appears: [Wed Mar 16 11:08:52 2011] [alert] [client 127.0.0.1] /home/htdocs/site.com/www/.htaccess: Redirect to non-URL Mod rewrite is installed, also redirect 500 error htaccess tried to provide urls without quotes. On production server this .htaccess works fine, but on local causes troubles Any ideas, please) This rule works Redirect 301 "/page1.html" "http://www.site.com/dir1/" but I need a way to supply relative paths instead of full urls (production server works that way) .htaccess apache2 share|improve this question edited Apr 7 '11 at 10:31 asked Mar 16 '11 at 9:54 Dmitry Evseev 9,02132441 add a comment| 3 Answers 3 active oldest votes up vote 5 down vote accepted Changed all Redirect 301 rules to: RewriteRule ^/page1.html$ /dir1/page.html [R=301,L] now working. But how does it work on production? share|improve this answer answered Apr 7 '11 at 10:31 Dmitry Evseev 9,02132441 add a comment| up vote 1 down vote For me, I had the exact same issue. Adding "http://domain.com" in front of "/mypage" worked; I am still testing to get it to work without, as is does on my production server. So my .htaccess on my local testing environment, went like this: BROKEN: Redirect 301 /mypage /directory1/sub-directory/mypage/ FIXED: Redirect 301 http://mydomain.com/mypage http://mydomain.com/directory1/sub-directory/mypage/ share|improve this answer answered Mar 24 '11 at 23:32 adleviton 112 1 @user675891 thank you for your
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have
Htaccess 301 Redirect
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 http://stackoverflow.com/questions/5323557/redirect-301-in-htaccess-causes-500-server-error-redirect-to-non-url 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 http://serverfault.com/questions/257845/htaccess-301-redirect-produces-500-internal-server-error 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.1k6107181 Yep, thanks mate, that fixed it. –Steve Apr 12 '11 at 4:23 add
Error If this is your first visit, be sure to check out the FAQ by clicking the link above. You http://www.webdeveloper.com/forum/showthread.php?202301-HTACCESS-301-Redirect-causing-Internal-Server-Error may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 7 of 7 Thread: HTACCESS 301 Redirect causing Internal Server Error Tweet Thread Tools Show Printable Version Email this Page… Subscribe internal server to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 02-16-2009,07:21 AM #1 Mig View Profile View Forum Posts Visit Homepage Back in Black Join Date Jun 2005 Location London, UK Posts 191 HTACCESS 301 Redirect causing Internal Server Error I can't figure out what's causing my internal server error. This internal server error works OK: Code: Redirect 301 /apply.asp http://sub.example.co.uk/work.php Redirect 301 /default.asp http://sub.example.co.uk/ But it breaks if I add this line: Code: Redirect 301 /gallery.asp http://sub.example.co.uk/services/ Any ideas? Reply With Quote 02-16-2009,07:30 AM #2 scragar View Profile View Forum Posts Some Random Guy Join Date Jun 2003 Location here Posts 4,551 What are those two funny characters at the start of the line? If you are using PHP please use the [PHP] and [/PHP] forum tags for highlighting... The same applies to HTML and the forums [HTML][/HTML] tags. Reply With Quote 02-16-2009,09:26 AM #3 Mig View Profile View Forum Posts Visit Homepage Back in Black Join Date Jun 2005 Location London, UK Posts 191 Where? What characters? (Unless this is the problem) I see no non-standard characters other than alphanumeric and : / . Last edited by Mig; 02-16-2009 at 09:30 AM. Reply With Quote 02-16-2009,09:31 AM #4 scragar View Profile View Forum Posts Some Random Guy Join Date Jun 2003 Location here Posts 4,551 0