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 6837725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:30:41+00:00 2026-05-26T23:30:41+00:00

In a folder named rewrite I have two files, .htaccess and index.php <rewrite> –

  • 0

In a folder named rewrite I have two files, .htaccess and index.php

<rewrite>
- .htaccess
- index.php

In .htaccess I have this content

RewriteEngine On
RewriteRule ^([a-z0-9]+)?$ index.php?id=$1 [NC,L]

and in index.php

<?php
echo $_GET['id'];
?>

Isn’t supposed when I visit http://www.domain.com/rewrite/1234 I would get an output of 1234 ?

Instead of this there is created a file application/x-httpd-php for downloading that contains the code of index.php

I am trying to figure out why I can not make this happen. What am I missing here?

UPDATE
I have tested two web servers and local server. Finally it worked on one of the web servers, meaning that it has something to do with the configurations.


What should I do about it ?

  • 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-26T23:30:42+00:00Added an answer on May 26, 2026 at 11:30 pm

    Is possible that one of your servers hasn’t got the mod_rewrite activated.

    To ensure make a test:

    In a folder make two files:
    – .htaccess
    – rewrite.php

    In .htacces put:

    RewriteEngine On
    RewriteRule ^link([^/]*).html$ rewrite.php?link=$1 [L]
    

    and in rewrite.php put:

    <h2 align=center>
    <?
    if(isset($_GET['link']))
    {
        if($_GET['link']==1){echo "Link without use mod_rewrite";}
        elseif($_GET['link']==2){echo "Congratulations!! You has used Apache's mod_rewrite and works well.";}
        else{ echo "Verify the Apache's module mod_rewrite.";}
    }
    ?>
    </h2>
    <hr>
    <head>
    <title>Test mod_rewrite in Apache Linux</title>
    </head>
    <body>
    <h1>Test mod_rewrite in Apache Linux</h1>
    <p><a href="rewrite.php?link=1">Link one </a> = rewrite.php?link=1</p>
    <p><a href="link2.html">Link two</a> = link2.html</p>
    <ul>
    <li>Test link one</li>
    <li>Then test the link two</li>
    <li>If with the link two if the link two goes to a not found page then you have not activated the .htaccess or apache mod_rewrite is not working.</li>
    </ul>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have hundreds of files in one folder named like this: index.html?tab=This is -
I have a PHP scripted named index.php inside a folder named blog. There are
I have an htaccess file which maps http://www.myserver.com/home/ to http://www.myserver.com/index.php?section=home This part works fine.
I have a folder named repository in my admin folders. This folder holds 2
I have a content folder which is full of other sub-directories named in the
I have one folder named test located at www.mydomain.com/abc/files/test. I need to change the
I have a docs folder in a Subversion repository named project. I've come to
I have a folder named Comics and sub folders in that directory with the
Windows x64 versions contain folders named with parenthesis like \Program Files (x86) and this
Having a bit of trouble with htaccess, at the moment I have a rewrite

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.