redirect with mod_rewrite not working in wamp

0

Mod_rewrite is already enabled as we can see in www.joocebox.com/?phpinfo=1

I also made the change in the file httpd.conf as below:

DocumentRoot "c:/wamp/www/"
<Directory />
    Order Deny,Allow
    Deny from none
    Allow from 127.0.0.1
</Directory>

<Directory "c:/wamp/www/">
   Options Indexes FollowSymLinks
   AllowOverride all
   Options FollowSymLinks
   AllowOverride all
   Order deny,allow
   Allow from all
</Directory>

And finally I created the file .htaccess in the directory "c:/wamp/www/" with the following content:

#Ativando o mod_rewrite
RewriteEngine on
# Se o host for www.joocebox.com/trustbox
RewriteCond %{REQUEST_URI}^www.joocebox.com/trustbox$ [NC]
# A regra será a seguinte
RewriteRule ^(.*)$ http://trustbox.joocebox.com/$1 [R=301,L]

Well, the problem is that redirection is not performed! Returning the 404 error.

    
asked by anonymous 20.04.2015 / 20:54

1 answer

0

Personal was easier than I thought.

In my .htaccess it replaces all this:

#Ativando o mod_rewrite
RewriteEngine on
# Se o host for www.joocebox.com/trustbox
RewriteCond %{REQUEST_URI}^www.joocebox.com/trustbox$ [NC]
# A regra será a seguinte
RewriteRule ^(.*)$ http://trustbox.joocebox.com/$1 [R=301,L]

So:

RewriteEngine on
Redirect 301 /trustbox http://trustbox.joocebox.com

Refinement: How to do a .htaccess 301 redirect

    
20.04.2015 / 22:23