Solved

Apache httpd  & htaccess problem

Posted on 2013-06-09
7
453 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

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…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 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

15 Experts available now in Live!

Get 1:1 Help Now