Solved

Apache httpd  & htaccess problem

Posted on 2013-06-09
7
452 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
  • 4
  • 3
7 Comments
 
LVL 1

Accepted Solution

by:
Uvg earned 500 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
This video discusses moving either the default database or any database to a new volume.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

759 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now