开发者

Error with "RewriteEngine On" in .htaccess file on web server

RewriteEngine On
RewriteRule ^bloco/(.*)$ bloco.php?id=$1
RewriteRule ^bloco/(.*)/$ bloco.php?id=$1

My .htaccess file have that configuration, work well on my local server but at web server dont work...

local: domain.com/bloco/590

web server: domain.com/bloco/?id=590

right now (not working...)

Options +FollowSymLinks

Options -Indexes

RewriteEngine On
RewriteEngine On
RewriteRule ^bloco/(.*)(/?)开发者_如何学运维$ /carnaval/blocosderua/bloco.php?id=$1 [NC,L]

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1\.php

php_value allow_url_fopen 1
php_value allow_url_include 1

any help?


Modify your RewriteRule to look like this:

RewriteEngine On
RewriteRule ^bloco/(.*)(/?)$ /bloco.php?id=$1 [NC,L]

This assumes bloco.php is in your root. If it is not, you will need to specify the path to it:

RewriteRule ^bloco/(.*)(/?)$ /path/to/bloco.php?id=$1 [NC,L]


Not all hosting companies allow you to use the rewrite engine. If your getting an error try to see if it also does with only the RewriteEngine On rule. If it does I'm afraid your not allowed to use it.

As for the rules they look fine to me.

Greets Michael


You probably need to include Options +FollowSymLinks at the top of your .htaccess. Otherwise this will need to be configured in your httpd.conf.

This will basically allow you to override configuration values in your .htaccess.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜