Internal Server Error After 301 Redirect
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings htaccess redirect 500 internal server error and policies of this site About Us Learn more about Stack Overflow
Redirect 500 Error Htaccess
the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation redirect 301 htaccess 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 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| 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: B
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 to SEO The Local Learning Center The Beginner's Guide to ContentMarketing 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, http://stackoverflow.com/questions/5323557/redirect-301-in-htaccess-causes-500-server-error-redirect-to-non-url but in order 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 https://moz.com/community/q/can-an-incorrect-301-redirect-or-htaccess-code-cause-500-errors Answered Product Support Unanswered From 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 S
301 /products/tech.html /products/technology.html It doesn't matter if I used the absolute URL or not for the new destination. sparek 2008-10-23 18:53:34 UTC #2 You say that you are inserting a handful. What happens if you https://www.sitepoint.com/community/t/301-re-directs-in-htaccess-cause-internal-server-errror-500/4359 just insert one? You may have a syntax error in one of the lines that you are inserting. You can also check the Apache error log for more information. mgm_03 2008-10-23 19:06:24 UTC #3 When I only use one, I get the same result. sparek 2008-10-23 19:12:38 UTC #4 What does the Apache error log show when you encounter this error? SariJ 2008-10-24 03:02:36 UTC #5 Is RewriteEngine kept On and hope the .htaccess internal server is enabled via the apache conf with the AllowOverride All variable? SergHZ 2008-10-24 06:45:48 UTC #6 Make sure that Apache is compiled with mod_rewrite module on your server. Otherwise you will get an Internal Server error when you use rewrite rules. dklynn 2008-10-25 05:58:28 UTC #7 HZ: Really? Redirect is mod_alias (Apache core) and mod_rewrite has NOTHING to do with it! PLEASE don't scare me like this - I have my (VPS) account there! mgm: internal server error I suspect that sparek is correct - that you have a syntax error in your Redirect statement(s) http://httpd.apache.org/docs/2.0/mod/mod_alias.html#redirect said: Redirect Directive Description: Sends an external redirect asking the client to fetch a different URLSyntax: Redirect [status] URL-path URLContext: server config, virtual host, directory, .htaccessOverride: FileInfoStatus: BaseModule: mod_alias The Redirect directive maps an old URL into a new one by asking the client to refetch the resource at the new location. 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.Example: Redirect /service http://foo2.bar.com/service If the client requests http://myserver/service/foo.txt, it will be told to access http://foo2.bar.com/service/foo.txt instead. Note Redirect directives take precedence over Alias and ScriptAlias directives, irrespective of their ordering in the configuration file. Also, URL-path must be a fully qualified URL, not a relative path, even when used with .htaccess files or inside of