Change to HTACCESS: Rewritre URL to insert domain

Asked

Viewed 384 times

1

Good morning!

I have a site working today at Locaweb, and it has presented several problems of slowness and we believe to be the server.

We’re trying to migrate to Hostgator for testing, and we’re using the temporary access address. But, this URL has a directory in the URL to access (http://br820.hostgator.com.br/~gpapr829/), and has compromised my user friendly URL system.

My code:

<IfModule mod_rewrite.c>
    RewriteEngine On
    # URL Amigável
    RewriteRule ^(common|sistema|upload)($|/) - [L]
    RewriteRule !\.(css|js|xml|bmp|swf|flv|ico|html|pdf|woff|ttf|svg|eot|zip|mp3|jpg|png|gif|jpeg|ai|eps|ico)$ index.php [L]
</IfModule>

When I leave this code active, it doesn’t even enter the site. I had to comment on the Rewriterules in order to access the home. I believe it stems from the second Rewriterule having the index.php. However, I tried to adjust by placing the directory:

RewriteRule !\.(css|js|xml|bmp|swf|flv|ico|html|pdf|woff|ttf|svg|eot|zip|mp3|jpg|png|gif|jpeg|ai|eps|ico)$ ~gpapr829/index.php [L]

Result: Error 500.

I tried too:

RewriteRule !\.(css|js|xml|bmp|swf|flv|ico|html|pdf|woff|ttf|svg|eot|zip|mp3|jpg|png|gif|jpeg|ai|eps|ico)$ "/~gpapr829/index.php" [L]

No 500 error, but it doesn’t work either. Go to 404 server.

What can I do in this case?

  • Have you checked if mod_rewrite is active? You can see this with the phpinfo(); Put this function in a test script and run, in the result look for the line on which trim Loaded Modules and see if mod_rewrite is in the list of apache enabled modules.

  • Yes, I checked and it is active yes! Otherwise, he wouldn’t even be on Ifmodule’s parole. But I also thought it could be something like this.

No answers

Browser other questions tagged

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