How to create universal .htaccess file?

夙愿已清 提交于 2019-12-13 03:56:57

问题


I've built a script and implemented RewriteRule. The RewriteRule is working fine on Godaddy Linux shared hosting. But not on dreamhost, hostgator and on windows server.

I want to make these url-rewrite rules "universal" so that my script work on all different server "including windows". How can I make my .htacces file universal? Is there any other solution without .htaccess?

Here is the .htaccess I'm using

AddHandler x-httpd-php5-cgi .html
Options +FollowSymLinks
Options -MultiViews
RewriteEngine On
RewriteRule ^genres/([^/]*).html /category.php?category=$1
RewriteRule ^search.html$ search.php
RewriteRule ^([^/]*)-product.html$ /productinfo.php?request=$1 [L]
RewriteRule ^new/([^/]*)\-product.html$ productinfo.php?new_request=$1 [L]
RewriteRule ^download/([^/]*)\-product.html$ download.php?download=$1 [L]
RewriteRule ^new-download/([^/]*)\-product.html$ download.php?new_download=$1 [L]
RewriteRule ^buy/([^/]*)\-product.html$ buy.php?buy=$1 [L]
RewriteRule ^new-buy/([^/]*)\-product.html$ buy.php?new_buy=$1 [L]

来源:https://stackoverflow.com/questions/10075885/how-to-create-universal-htaccess-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!