开发者

Apache mod_rewrite does not work

开发者 https://www.devze.com 2023-02-11 12:57 出处:网络
Im using a J2ee application with spring framework 2.0 on a apache tomcat 5.5. I have used URL mapping to change the extension from .jsp to .htm. I have an URL which looks like this

Im using a J2ee application with spring framework 2.0 on a apache tomcat 5.5. I have used URL mapping to change the extension from .jsp to .htm. I have an URL which looks like this http://www.800promotion.com/promotion.htm?cid=1344159422528120632840257756098788 I want to change it to http://www.800promotion.com/1344159422528120632840257756098788 I have referred samples of working on mod_rewrite. However I cant seem to get it working. These are the lines in my .htaccess file. RewriteEngine on RewriteRule ^([^/.]+)/?$ /promotion.htm?cid=$1 [L]

I have checked with my host and they said mod_rewrite was supported on the server. I do not have access to the httpd.conf file. However I have verified from the support that AllowOverri开发者_JS百科de is set to all. When I hit the URL the page works fine however the URL doesnt get mapped. Where am I going wrong?


RewriteEngine On
RewriteRule ^(.+)$ promotion.htm?cid=$1 [QSA,L]

Try this


You need a correct .htaccess directives. Try the following solution:

RewriteEngine on
RewriteBase /
RewriteRule (.*) promotion.htm?cid=$1 [L,I,U]
0

精彩评论

暂无评论...
验证码 换一张
取 消