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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:04:51+00:00 2026-05-29T19:04:51+00:00

I have a web-site in the directory d:\www\mysite on my local computer. I installed

  • 0

I have a web-site in the directory d:\www\mysite on my local computer. I installed WAMPServer and set up an alias directory mysite for my site.

So, for instance, http://localhost/mysite/static-resource.html correctly retrieves my file which is located in d:\www\mysite\static-resource.html.

My issue is with the URL rewriting in my .htaccess file:

RewriteEngine On    
RewriteRule ^articles/(\d+) ./article.php?id=$1

When I try to access http://localhost/mysite/articles/1, I get this response:

Not Found

The requested URL /www/mysite/article.php was not found on this
server.

I can confirm that there exists a article.php file at d:\www\mysite\article.php.

In the past, I had the root of my site (d:\www\mysite) set up as the DocumentRoot of the Apache server (instead of c:\wamp\www which is the default), and in that scenario, my URL rewriting worked, so my current issue must be related to the fact that my site is “behind” an alias directory.


The contents of my mysite.conf file:

Alias /mysite/ "d:/www/mysite/" 

<Directory "d:/www/mysite/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order allow,deny
    Allow from all
</Directory>
  • 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-29T19:04:52+00:00Added an answer on May 29, 2026 at 7:04 pm

    I do not see a RewriteBase in your rewrite rules.
    In your .htaccess, add a RewriteBase rule.

    RewriteEngine On    
    RewriteBase /mysite/
    RewriteRule ^articles/(\d+) ./article.php?id=$1
    

    RewriteBase has to have /mysite/ because of your Alias /mysite/ "d:/www/mysite/"

    If just http://localhost/mysite is accessed, It should return a not found on this server.
    If you do not want this to happen, add another alias along with the above like this:

    Alias /mysite "d:/www/mysite/" 
    

    or

    Just this:

    AliasMatch /mysite(/.*)? d:/www/mysite/$1 
    

    why a RewriteBase? from RewriteBase Directive Apache Docs:

    The RewriteBase directive explicitly sets the base URL for per-directory rewrites. As you will see below, RewriteRule can be used in per-directory config files (.htaccess). In such a case, it will act locally, stripping the local directory prefix before processing, and applying rewrite rules only to the remainder. When processing is complete, the prefix is automatically added back to the path. The default setting is; RewriteBase physical-directory-path

    When a substitution occurs for a new URL, this module has to re-inject the URL into the server processing. To be able to do this it needs to know what the corresponding URL-prefix or URL-base is. By default this prefix is the corresponding filepath itself. However, for most websites, URLs are NOT directly related to physical filename paths, so this assumption will often be wrong! Therefore, you can use the RewriteBase directive to specify the correct URL-prefix.

    Example from RewriteBase Directive Apache Docs:

    #
    #  /abc/def/.htaccess -- per-dir config file for directory /abc/def
    #  Remember: /abc/def is the physical path of /xyz, i.e., the server
    #            has a 'Alias /xyz /abc/def' directive e.g.
    #
    
    RewriteEngine On
    
    #  let the server know that we were reached via /xyz and not
    #  via the physical path prefix /abc/def
    RewriteBase   /xyz
    
    #  now the rewriting rules
    RewriteRule   ^oldstuff\.html$  newstuff.html
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web site http://www.mydomain.com Here I have created a sub folder http://www.mydomain.com/products
I have two folders for a particular web site. There is the main www.mysite.com
I have a MOSS web site with its virtual directory in IIS. That VD
I have IIS 7.5 With one web site I added new virtual directory and
Windows 2003/IIS 6... I have a virtual directory on a web site that closely
I have a PHP web site that has two directories: An application directory and
Here's the setup. I have web site which is essentially a simple CMS. Here
I have a web site (ASP.NET, no MVC) with multiple web forms for filling
I have a site new.mysite.com in Drupal. In the vhost file I have a
here's my setup: I have an MVC3 site hosted with a www subdomain (e.g.,

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.