redirecting with mod_rewrite not working on wamp

Asked

Viewed 527 times

0

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

I made the change also in the archive 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 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 the redirect is not performed! Returning error 404.

1 answer

0


Guys it was easier than I thought.

In my .htaccess 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]

That’s why:

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

Refência: How to do a . htaccess 301 redirect

Browser other questions tagged

You are not signed in. Login or sign up in order to post.