Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Apache httpd  & htaccess problem

Posted on 2013-06-09
7
Medium Priority
?
461 Views
Last Modified: 2013-06-10
Hello experts
I'm testing local my site but i have a problem.
I'm working with OS windows xp pro, apache 2,mysql, coldfusion.
settings:
1. hosts file:
127.0.0.1 mysite.selfip.com
2. httpd virtualhost:
<VirtualHost  *:80>
    ServerAdmin mysite.selfip.com
    # Root folder for my scratchpad stuff
    DocumentRoot "C:/Inetpub/wwwroot/mysite"
    ServerName mysite.selfip.com
    # Alias for /CFIDE, which the CF install placed in my Apache webroot.
    # This is solely for our dev environment, and would not be a good practice
    # within a production environment
    Alias /CFIDE "C:/Apache2/htdocs/CFIDE"
    <Directory "C:/Apache2/htdocs/CFIDE">
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
    ErrorLog logs/mysite.loc-error.log
    CustomLog logs/mysite.loc-access.log common
</VirtualHost>

Now if i type:
mysite.selfip.com in the address bar it redirects to www.mysite.selfip.com and i get a not found error .
If i type:
mysite.selfip.com/index.cfm
it is working.

Any help?
0
Comment
Question by:Panos
[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
  • 4
  • 3
7 Comments
 
LVL 1

Accepted Solution

by:
Uvg earned 2000 total points
ID: 39233994
1. hosts file
127.0.0.1 mysite.selfip.com www.mysite.selfip.com 

2. After line
ServerName mysite.selfip.com

Add:
ServerAlias www.mysite.selfip.com

The browser add www because mysite.selfip.com respond an error. It looks like you didn't specify DirectoryIndex correctly and deny Directory listing.

You may additionaly add
DirectoryIndex index.cfm
somewhere inside VirtualHost. This will solve browser www. redirect.
0
 
LVL 2

Author Comment

by:Panos
ID: 39234044
Hi.
i can't test it now because i'm not on my working pc but is it possible to add/change my htaccess instead of the virtualhost in the httpd file?
0
 
LVL 1

Expert Comment

by:Uvg
ID: 39234061
As far as I know DirectoryIndex may be putted in .htaccess, but ServerAlias must be in httpd.conf file(or included in it).
Correct DirectoryIndex may be enough for you.
0
Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

 
LVL 2

Author Comment

by:Panos
ID: 39234089
Ok thank you. I will reply after testing.
0
 
LVL 2

Author Comment

by:Panos
ID: 39235512
Ok it is working. I had to clear the browser cache too. Thank you
0
 
LVL 2

Author Closing Comment

by:Panos
ID: 39235547
Thank you
regards
panos
0
 
LVL 1

Expert Comment

by:Uvg
ID: 39236659
You succeed - I'm glad :)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

688 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