Answer the question
In order to leave comments, you need to log in
Apache mod_rewrite windows server 2008. How?
I want to configure what would be when opening: the www.myexamplehost.com/google.html
user saw the content / content www.myexamplehost.com/index.html
There is an almost default apache config.
ServerRoot "C:/Program Files (x86)/Apache Software Foundation/Apache2.2"
Listen 80
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule include_module modules/mod_include.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
User daemon
Group daemon
</IfModule>
</IfModule>
ServerAdmin [email protected]
ServerName www.myexamplehost.com:80
DocumentRoot "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs"
<directory />
Options All
AllowOverride All
RewriteEngine on
</directory>
<VirtualHost *:80>
ServerName www.myexamplehost.com
Options Indexes FollowSymLinks MultiViews
RewriteRule ^/google\.html$ /index.html [L]
</VirtualHost>
google.html index.html.
http://www.myexamplehost.com/google.html
I see the contents of google.html
, not index.html
. Answer the question
In order to leave comments, you need to log in
the rewrite mod gives this possibility, then it needs to be used in the .htaccess file in the working folder.
For example, I usually have this config:
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question