We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,307 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

.htaccess Causing Error : 500 - RewriteRules

I am not to sure where to put this post but this seemed like the best place.

I am currently writing scripts for page redirects, however, I can not get my .htaccess redirects working first.
I need to take from my root, and redirect to a subscript:

http://www.example.com -> /index.php
http://www.example.com/newpage -> /pages/fetchpage.php?id=newpage

I have other RewriteRules already no problem, but when I add the following line:

RewriteRule ^(.*) pages/fetchpage.php?id=$1 [NC,L]

I get a server error:

500 Internal Server Error
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, support@globat-inc.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

Globals:

RewriteBase         /
RewriteCond         %{HTTP_HOST}        ^tinyclark.com                              [NC]
RewriteRule         ^(.*)$              http://www.tinyclark.com/$1                 [R=301,L]

And I also tried commenting out all other Rules in the event of conflicting rules, and still no change. I have seen the above example on numerous sites giving no one else problems.

Any and all help is greatly appreciated.
~tinyClark

2
Contributors
1
Reply
31 Minutes
Discussion Span
9 Months Ago
Last Updated
2
Views
Question
Answered
mrclark
Light Poster
42 posts since May 2009
Reputation Points: 10
Solved Threads: 2
Skill Endorsements: 0

This should help:

RewriteEngine On
RewriteRule ^([^/]*)$ /pages/fetchpage.php?id=$1 [L]

Squidge
Posting Pro in Training
433 posts since Dec 2009
Reputation Points: 111
Solved Threads: 65
Skill Endorsements: 5
Question Answered as of 9 Months Ago by Squidge

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page generated in 0.0575 seconds using 2.67MB