Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5943701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:25:59+00:00 2026-05-22T16:25:59+00:00

Why is my htaccess file causing a 500 error? I am trying to get

  • 0

Why is my htaccess file causing a 500 error?

I am trying to get it so when anyone enters http://www.example.com/24 it will run the script for the ‘key’ 24 but the server reads http://www.example.com/?key=24.

Php script on index.php:

<?php include("scripts/config.php");
include("scripts/facebook.php");

if(isset($_GET['key'])){

$like_id=mysql_real_escape_string($_GET['key']);

include_once 'like/index.php';

}else{

include_once 'home.php';


}
?>

htaccess code:

RewriteEngine On

RewriteRule ^([a-zA-Z0-9_-]+)/\index$ index.php?key=$1

RewriteRule ^([a-zA-Z0-9_-]+)/\index$ index.php?key=$1

Also could it be where i’m saving my htaccess file? currently its in the htdocs folder.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T16:26:00+00:00Added an answer on May 22, 2026 at 4:26 pm

    Try this:

    RewriteEngine On
    RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?key=$1
    

    In any case, your current rules should not trigger a 500 status code unless mod_rewrite is not enabled.

    Edit: I’ve just noticed that you spell it htaccess all around the question. The correct name is .htaccess (note the leading dot).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my htaccess file RewriteBase / RewriteCond %{HTTP_HOST} ^example.com [NC] RewriteRule ^(.*)$ http://www.example.com/$1
What is causing a 500 error with the below code in the .htaccess file?
So my .htaccess file looks like this RewriteBase / Redirect 301 /page.html http://www.yoursite.com/newpage.html Redirect
I have DocumentRoot /var/www/test in my .htaccess file. This is causing the apache server
The htaccess file below crashed the site with an internal server error (500). This
if I have an .htaccess file on my site located at example.com/folder1/folder2/.htaccess and I
I have a .htaccess file in the root of a website: /var/www/mywebsite/htdocs/.htacess and I
I am having difficulty with code igniter routing. http://www.mysite.com goes to the right controller
My website needs a .htaccess file that will redirect a user to index.php when
I have written the following rules in .htaccess RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\.com RewriteCond %1 !^www$

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.