We help IT Professionals succeed at work.
Get Started

Apache - friendly urls and mod_rewrite issue

kevinvw1
kevinvw1 asked
on
283 Views
Last Modified: 2015-03-29
NOTE: I am working with Phalcon tutorial -
http://docs.phalconphp.com/en/latest/reference/apache.html

This is Apache on Windows.

I have a web page that I can browse to with no issues -
https://localhost:8443/tutorial/index.php

I have set up the rewrite rules in the httpd.conf file (not using .htaccess) -

<IfModule mod_rewrite.c>

    <Directory "c:/Apache24/htdocs/tutorial">
        RewriteEngine on
        RewriteRule  ^$ public/    [L]
        RewriteRule  (.*) public/$1 [L]
    </Directory>

    <Directory "c:/Apache24/htdocs/tutorial/public">
        RewriteEngine On
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]
    </Directory>

</IfModule>

But when I browse to https://localhost:8443/tutorial/
I get the directory listing of the public folder -

Index of /tutorial/public

Parent Directory
css/
img/
index.php
js/

It takes me to the public folder so it seems that part of the rewrite is working.

Any ideas what I'm missing?

Thanks,

Kevin.
Comment
Watch Question
Lead Platform Engineer
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 2 Answers and 5 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE