logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Rewrite doesn't work in virtualhost block
Author
Qmpeltaty



Joined: 06 Feb 2008
Posts: 182
Location: Poland

PostPosted: Wed 08 Feb '17 17:45    Post subject: Rewrite doesn't work in virtualhost block Reply with quote

Hello

I have a simple rewrite

Code:
RewriteEngine On
RewriteRule ^$ /start [L,R=301]

which rewrite all users entering the page to /start alias. When i put it inside virtualhost block the rewrite doesn't work. When i put it into .htaccess file and place it in the DocumentRoot directory it works as expected. What could be the reason ?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Fri 10 Feb '17 18:27    Post subject: Reply with quote

Put the rewrite rule in the <Directory> block of your document root.
Back to top


Reply to topic   Topic: Rewrite doesn't work in virtualhost block View previous topic :: View next topic
Post new topic   Forum Index -> Apache