?
Solved

RE-WRITE RULE ERROR

Posted on 2006-11-27
10
Medium Priority
?
273 Views
Last Modified: 2008-02-01
Hi,

I'm using easyphp.

I'm just getting into url re-writing for my site but am having what I think may be a configuration error more than anything.

I've put my .htaccess file in my root folder, the file contains the following:
RewriteEngine on
RewriteRule ^index\.php$ contactUs.php

Just a simple re-write as my first attempt.

However I am getting the following error:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.



--------------------------------------------------------------------------------

Apache/1.3.33 Server at 127.0.0.1 Port 80

can any1 help?
0
Comment
Question by:scm0sml
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
10 Comments
 
LVL 13

Accepted Solution

by:
rhickmott earned 2000 total points
ID: 18021822
Edit your httpd.conf file ( Normally under Apache/Conf) and find  make sure that the line

LoadModule rewrite_module modules/mod_rewrite.so

is not commented ( doesent have a # in front of it ) If it is then a call to Rewrite  will error as its an unknow function (Syntax error) hence the 500 Internel Server Error.
0
 

Author Comment

by:scm0sml
ID: 18021852
well it was commented out so i have removed the # but it still isnt working.

any other ideas?
0
 

Author Comment

by:scm0sml
ID: 18021968
ANY1 ELSE HELP?
0
Supports up to 4K resolution!

The VS192 2-Port 4K DisplayPort Splitter is perfect for anyone who needs to send one source of DisplayPort high definition video to two or four DisplayPort displays. The VS192 can split and also expand DisplayPort audio/video signal on two or four DisplayPort monitors.

 

Author Comment

by:scm0sml
ID: 18022208
i've just uploaded my .htaccess file and the re-write worked fine so clearly it is a config error.......
0
 
LVL 13

Expert Comment

by:rhickmott
ID: 18023325
Did you restart your server after you edited the file?

You will need to do this in order to get it to reload the config.
0
 

Author Comment

by:scm0sml
ID: 18025899
i did yeah. still not working tho :(
0
 
LVL 13

Expert Comment

by:rhickmott
ID: 18026266
The problem is *normally* this error is caused by the problem above. Rather than just ignoring the error Apache throws nasty 500 errors.

I haven't used Easy PHP in Years! not just because it uses old versions of PHP and Apache but also because its normally easier to install the two separately (as well as MySQL) and you get to see how the set-up works and once you have done it one or two times its pretty self explanatory after that.

Try having a look at the Apache\logs and see if theres anything in there that would explain it.

In the meantime if you just create a .htaccess file (blank) to start with and try a page and see if it works.

If it does then create JUST the line

RewriteEngine on

If it crashes then you can be guaranteed that its a problem with the Rewrite Engine not being loaded correctly check that the mod_rewrite.so file is in Apache/Modules.

If it is then as a nasty hack you could always try

LoadModule rewrite_module modules/mod_rewrite.so
RewriteEngine on
RewriteRule ^index\.php$ contactUs.php

Not the most neatest way of doing things.
0
 

Author Comment

by:scm0sml
ID: 18026287
ok im in work at the mo will try when i get home.

thanks
0
 

Author Comment

by:scm0sml
ID: 18029839
there was another line that needed to be commented in:

AddModule mod_rewrite.c

i'll give you the points as you got the one line.

we've both learned something then :)
0
 
LVL 13

Expert Comment

by:rhickmott
ID: 18029869
Most odd I don't seem to have a

AddModule mod_rewrite.c line In mine or even a mod_rewrite.c in my Apache Installation Folder.

It might be because im on Apache2 though.

good to see you got it sorted.

Regards

0

Featured Post

Supports up to 4K resolution!

The VS192 2-Port 4K DisplayPort Splitter is perfect for anyone who needs to send one source of DisplayPort high definition video to two or four DisplayPort displays. The VS192 can split and also expand DisplayPort audio/video signal on two or four DisplayPort monitors.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month13 days, 9 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question