Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Apache httpd  & htaccess problem

Posted on 2013-06-09
7
Medium Priority
?
463 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 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses
Course of the Month6 days, 12 hours left to enroll

783 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