I found that mod_rewrite function is not enabled on my server(_SERVER["SERVER_SOFTWARE"] -Microsoft-IIS/7.0),Architecture x86 .How can I enabled the mod_rewrite.Could any one please help me.
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
1) find httpd.conf (usually this file can be found in folder callled conf , config or something along those lines)
2) Find and uncomment the line LoadModule rewrite_module modules/mod_rewrite.so
3) Find the line with DocumentRoot “C:/path/to/my/root”, There you will find contents like
Make sure the content inside these two braces looks like
Options All
AllowOverride All
4) All done now restart the Apache server and you will be all good to go
The answer that worked for me was to install the Microsoft URL Rewrite module and then create a web.config file in the root of the site with this in it (the rules):
If your hosting at a commercial hosting provider they will most likely have the Microsoft URL Rewrite module installed. This gives you similar functionality to the Apache mod_rewrite module.
To test if this module is installed, create a file called
web.config
in the root of your website with the content below and try tohttp://www.domain.com/google
wheredomain.com
is your website's domain. If you get redirected to google.com your host has the URL rewrite module installed.web.config:
There is no free version of mod_rewrite for LINUX available for the Windows OS. The only way out that I found was to import a .htaccess file on IIS using URL REWRITE, which is freely available on the Web Platform Installer.
After installing the URL REWRITE component, follow the steps on the link below to import the .htaccess file and create its windows equivalent, the web.config file.
http://www.iis.net/learn/extensions/url-rewrite-module/importing-apache-modrewrite-rules
Cheers.