Solved

htaccess file issue

Posted on 2013-06-08
12
416 Views
Last Modified: 2013-06-08
Hello experts.
I'm testing my pages on a local computer with OS Windows XP Pro, Apache 2, Mysql, using Coldfusion serverlanguage but i have also PHP installed.
It seems that the htaccess file is complete ignored.
I followed all the instructions i found in the net:
1. un-commented LoadModule rewrite_module modules/mod_rewrite.so
2.Add this to my Virtualhost:
   <Directory "C:/Apache2/htdocs/CFIDE">
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
3. Following the instructions here:
 http://www.szehau.com/archives/2006/07/enable-htaccess-and-url-rewriting-in-apache-for-windows/
Add this line to my  httpd.conf file.
AccessFileName htaccess

4. Add this in my htaccess file:
Options +FollowSymLinks
RewriteEngine On
5. I created a testpage.html. Add the following line in htaccess file after RewriteEngine On:
ReWriteRule ^testpage$ testpage.html
And got the error:The requested URL /testpage was not found on this server.
5.Of course i restarted my apache server.

Any idea how to solve this?
0
Comment
Question by:Panos
  • 6
  • 6
12 Comments
 
LVL 26

Expert Comment

by:skullnobrains
ID: 39231981
ReWriteRule ^/testpage$ testpage.html
0
 
LVL 2

Author Comment

by:Panos
ID: 39231988
Hi.I get the same error:
The requested URL /testpage was not found on this server.
0
 
LVL 26

Expert Comment

by:skullnobrains
ID: 39232057
then please activate the rewrite log. verbosity =2 should be ok, and post

are you sure your .htaccess is even used ? stick an error inside and check you end up with a "500 configuration error" just to make sure
0
 
LVL 2

Author Comment

by:Panos
ID: 39232088
If this line:
gijhgkhkhg    
would create an error, i don't get any. It seems that the file is been ignored
0
 
LVL 26

Expert Comment

by:skullnobrains
ID: 39232126
did you name the file .htaccess or just htaccess ?
it should be .htaccess (mind the DOThtaccess) by default
check that it appears in httpd.conf if you have a non-default setup

i'd also move the allowoverride directive to httpd.conf just to make sure. i'm not 100% positive that you can allowoverrides in your vhost if you do not also do it in httpd.conf

let's first get that error to fire, and then worry about the rewrite rule

please post results. if none of the above helps, there are a few other things you may want to check...
0
 
LVL 2

Author Comment

by:Panos
ID: 39232134
The filename is .htaccess
attached the  httpd.conf file.Please take a look
httpd.txt
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 26

Accepted Solution

by:
skullnobrains earned 500 total points
ID: 39232152
are you sure it is not .htaccess.txt and you do not see the extension ? did you activate the option that allows to see the known extensions in your file browser ? if not and if you created the file with notepad or a similar tool, it most likely has an extension. you can check from the command line as well. "cd" to the directory and "dir"

you have "allowoverride none" under c:/inetpub/wwwroot
did you try to allow overrides there as i suggested ? ( actually this is most likely not the issue )

you can change the AccessFileName in httpd.conf or in the vhost to something different if that makes things easier
0
 
LVL 26

Expert Comment

by:skullnobrains
ID: 39232158
if you change the accessfilename, make sure you block access to the file
this is what apache does by default which covers all files that start with ".ht"

#
# The following lines prevent .htaccess and .htpasswd files from being 
# viewed by Web clients. 
#
<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>

Open in new window

extracted from your config so remember to name the file .htsomething or to modify this block or add a similar one in your vhost

using windows, this should be sensible (rather in the vhost but would work equally in httpd.conf)

<FilesMatch ".*htaccess.*">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>

AccessFileName htaccess.txt

Open in new window


and save your htaccess file as "htaccess" in notepad
0
 
LVL 2

Author Comment

by:Panos
ID: 39232168
I changed the "allowoverride none" under c:/inetpub/wwwroot to allowoverride all  and now i'mgetting the wanted 500 error.htaccess is working now but i have to find out why i have an error



it is .htaccess not htaccess.txt. . i copied the file to a text file that 's why it is htaccess.txt
0
 
LVL 2

Author Comment

by:Panos
ID: 39232184
I will find the issue.now. I know how to go on. Thank you for your help
0
 
LVL 2

Author Closing Comment

by:Panos
ID: 39232189
Thank you very much
regards
panos
0
 
LVL 26

Expert Comment

by:skullnobrains
ID: 39232256
glad to see you got it straight. feel free to post if something bugs you later on
thanks for posting back
best regards
0

Featured Post

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ports for sccm 2012 1 75
Increase number of concurrent connections in Apache tomcat 6 2 63
Re-position sub-options beneath the TAB 7 77
Setting Up Local Lan Web Server 1 48
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn how to count occurrences of each item in an array.

896 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

11 Experts available now in Live!

Get 1:1 Help Now