RewriteRule gives HTTP 500 error

user2583012

On my website, www.example.com/ shows files which are in /, the root folder. But what I want is that example.com/ shows files which are in /www/. So I add the following code in my .htaccess file :

RewriteCond %{HTTP_HOST} ^www.example.com$
RewriteRule ^(.*)$ /www/$1 [L]

But it displays a 500 error. Somebody could say to me what is wrong ?

Lucas Willems

Try this code :

RewriteCond %{HTTP_HOST} ^www.example.com$
RewriteCond %{REQUEST_URI} !^/www/
RewriteRule ^(.*)$ /www/$1 [L]

It will rewrite the url once and stop the redirection loop.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Laravel project deployment gives the HTTP ERROR 500

From Dev

Configuring apache solr search on localhost gives error: HTTP ERROR 500

From Dev

htaccess RewriteRule 500 error - loop

From Dev

.htaccess rewriterule 500 internal error

From Dev

sql data to json array using PHP gives HTTP ERROR 500

From Dev

sql data to json array using PHP gives HTTP ERROR 500

From Dev

codeigniter 3, file upload gives HTTP ERROR 500

From Dev

.htaccess RewriteRule 500 Internal Server Error

From Dev

RewriteRule giving 500 Internal Server Error

From Dev

forced Https RewriteRule .htaccess gives 403 error

From Dev

Struts project with DynaValidatorForm gives HTTP status 500 error - "Resources cannot be null"

From Dev

HTTP error 500 on Android

From Dev

Python HTTP Error 500

From Dev

Apache2 RewriteRule 500 Internal Server Error

From Dev

Apache2 RewriteRule 500 Internal Server Error

From Dev

CURL gives 500 Internal server error

From Dev

Creating symlink gives 500 Internal Server Error

From Dev

.htaccess file gives 500 internal server error

From Dev

Joomla loginform gives 500 error on bad attempt

From Dev

Creating symlink gives 500 Internal Server Error

From Dev

Wordpress admin gives me 500 error

From Dev

PHP MySql insert gives server error 500

From Dev

Catch "HTTP500 Error"

From Dev

Apache RewriteRule servererror 500

From Dev

Injecting http in a service gives "No provider for Http!" error

From Dev

FileRun gives HTTP 500 white page when trying to install

From Dev

Jupyer lab gives Error 500: Internal Server Error

From Dev

Ajax call to webmethod gives ERROR 500 Internal server error

From Dev

Display error message on HTTP error 500

Related Related

HotTag

Archive