Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Senior Member tekp's Avatar
    Join Date
    Jan 2004
    Location
    A small village near a small city near a small cit
    Posts
    918
    Member #
    4667
    Liked
    1 times
    Okay, I'm using a .htaccess file in my root directory with the following:

    RewriteEngine on
    RewriteRule !\.(gif|jpg|css)$ /other/projects/tekpprint2/core.php
    That path leads to a file definately but whenever I try to access a URL it gives a 500 Internal Server error? AllowOverride is set to All in my httpd.conf, too.

    Any ideas? :/
    tekp :cheeky: tekponline.com

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Are you trying to make any file that isn't a .gif/.jpg/.css get processed by your script. Here's something from my vhosts.conf--which BTW, I encourage you to edit configuration files isntead of using .htaccess options, but you'll need root access and have to restart Apache--that's shockingly similar to what you're trying to do, and if you're clever, you can guess what project this is being used for:
    Code:
    RewriteEngine on
    RewriteRule ^/v6/(?!static/)(.*)$ /v6/index.php
    Meaning anything anything in the /v6 directory, but not in the v6/static directory, will get handled by /v6/index.php instead. This has the advantage over file extensions of letting any file get treated as static so long as it's inside the static directory, regardless of the extension (example: you're missing .png, .html, etc.).
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Senior Member tekp's Avatar
    Join Date
    Jan 2004
    Location
    A small village near a small city near a small cit
    Posts
    918
    Member #
    4667
    Liked
    1 times
    But yeah, I just wanted a script that would redirect any file other than those three.. actually, thinking about it, it could just be a script that redirected any .php file (but not .inc.php) to a certain file, would that be possible?
    tekp :cheeky: tekponline.com

  5. #4
    Senior Member tekp's Avatar
    Join Date
    Jan 2004
    Location
    A small village near a small city near a small cit
    Posts
    918
    Member #
    4667
    Liked
    1 times
    Plus I get a 500 error when I use that code you just gave me, too?

    It must be something on my part that's making it not work?
    tekp :cheeky: tekponline.com

  6. #5
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Perhaps your host has (or you have) Apache configured to not allow .htaccess files (AllowOverride None, or your AllowOverride All is pointing to the wrong directory) or to not allow mod_rewrite. I know for sure that the above mod_rewrite directive works, at least for Apache 2.2 on SUSE Linux 10.1. Of course, you'll need to edit it to point to the correct paths.

    edit: check your error_log file to see what the 500 error is saying.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  7. #6
    Senior Member tekp's Avatar
    Join Date
    Jan 2004
    Location
    A small village near a small city near a small cit
    Posts
    918
    Member #
    4667
    Liked
    1 times
    Ahh! I just had to uncomment the LoadModule for the mod_rewrite thanks!
    tekp :cheeky: tekponline.com


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search tags for this page

mod rewrite apache 500 internal error

Click on a term to search for related topics.
All times are GMT -6. The time now is 04:42 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com