Htaccess 301 Redirect 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 more about Stack
Htaccess Redirect 500 Internal Server Error
Overflow the company Business Learn more about hiring developers or posting ads with us Stack redirect 500 error htaccess Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community
Redirect 301 Htaccess
of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Redirect 301 in .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 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,06132441 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,06132441 add a comment| Did you find this question interesting? Try our newsletter Sign up for our newsletter and get our top new questions delivered to your inbox (see an example). Subscribed! Success! Please click the link in the confirmation email to activate your subscription. 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 respons
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 http://stackoverflow.com/questions/5323557/redirect-301-in-htaccess-causes-500-server-error-redirect-to-non-url 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 http://serverfault.com/questions/257845/htaccess-301-redirect-produces-500-internal-server-error 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 Sign up using Email and Password Post as a guest Name Email Post as
SEO with marketing resources for all skill levels: best practices, industry survey results, webinarsandmore. Advance your marketing skills: Local Marketing | Content | Social Media Get started with: The Beginner's Guide https://moz.com/community/q/can-an-incorrect-301-redirect-or-htaccess-code-cause-500-errors to SEO The Local Learning Center The Beginner's Guide to ContentMarketing http://webmasters.stackexchange.com/questions/49595/htaccess-file-size-causes-500-internal-server-error Q&A Get answers from the Moz Community Help Hub Learn how to use Moz Products Community & Events Connect with 500K online marketers Blogs Read the Moz Blog and YouMoz The Moz Q&A Forum Questions Search/Browse Ask the Community Hey friend! Have fun exploring Q&A, but in order internal server to ask your own questions, comment, or give thumbs up, you need to be logged in to your Moz Pro account. You can also earn access by receiving 500 MozPoints from participating in YouMoz and the Moz Blog! How does Q&A work? Have a Question? Browse Questions View All Questions Bounty New (No Responses) Discussion Answered Product Support Unanswered From internal server error All Time Last 30 Days Last 7 Days Last 24 Hours Sorted by Latest Questions Recent Activity Most Thumbs Up Most Responses Fewest Responses Oldest Questions With category All Categories Affiliate Marketing Alternative Search Sources Analytics Behavior & Demographics Branding / Brand Awareness Competitive Research Consulting Tips & Trends Content & Blogging Conversion Rate Optimization Educational Resources Email Marketing Entrepreneurship Inbound Marketing Events Inbound Marketing in the Media Inbound Marketing Industry Intermediate & Advanced SEO International Issues Internet Advertising Interviews Keyword Research Legal Link Building Local Listings Local Strategy Local Website Optimization Management / Culture Mobile and Local Moz News Moz Tools On-Page / Site Optimization Online Marketing Tools Paid Search Marketing PRO Application Reporting Reputation Management Reviews and Ratings Search Engine Trends Social Media Social Media for Local Search Support - Account Help Support - Feature Requests Support - Followerwonk Support - Getting Started Support - Moz Analytics: Brand & Mentions Support - Moz Analytics: Links Support - Moz Analytics: Search Support - Moz Analytics: Social Support - Moz APIs Support - Moz Local Support
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 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 file size causes 500 Internal Server Error [closed] up vote 2 down vote favorite 1 As soon as my .htaccess goes over approx 8410 bytes, I get a 500 Internal Server Error. I don't think this is due to a bad redirect, as I have experimented with redirects in the .htaccess and then with just text that is commented out #. (no actual commands in the .htaccess file) Is there anything obvious that can cause this? Update: The site is on WordPress. Here are the redirects I was originally trying to add: RewriteEngine On ## 301 Redirects of old URLs to new # 301 Redirect 1 RewriteCond %{QUERY_STRING} ^$ RewriteRule ^accesseries/underlay/prod_37\.html$ /product-category/accessories/underlays? [R=301,NE,NC,L] # 301 Redirect 2 RewriteCond %{QUERY_STRING} ^$ RewriteRule ^accessories/acoustic-underlay/prod_29\.html$ /product/acoustic-underlay/? [R=301,NE,NC,L] # 301 Redirect 3 RewriteCond %{QUERY_STRING} ^$ RewriteRule ^accessories/cat_4\.html$ /product-category/accessories/? [R=301,NE,NC,L] # 301 Redirect 4 RewriteCond %{QUERY_STRING} ^$ RewriteRule ^-bamboo-flooring/accessories/cat_8\.html$ /product-category/accessories/? [R=301,NE,NC,L] # 301 Redirect 5 RewriteCond %{QUERY_STRING} ^$ RewriteRule ^-bamboo-flooring/bamboo-floor/natural-strandwoven-bamboo-semi-gloss-wide-board-135mm-click/prod_151\.html$ /product/natural-strand-woven-bamboo-semi-gloss-wide-board-135mm-click/? [R=301,NE,NC,L] # 301 Redirect 6 RewriteCond %{QUERY_STRING} ^$ RewriteRule ^-bamboo-flooring/bamboo-floor/strandwoven-chocolate-135mm-bamboo-flooring/prod_174\.html$ /product/strand-woven-chocolate-135mm-bamboo-flooring/? [R=301,NE,NC,L] # 301 Redirect 7 RewriteCond %{QUERY_STRING} ^$ RewriteRule ^-bamboo-flooring/bamboo-floor/strand-woven-kem