重写网址不起作用

时间:2018-04-03 01:24:22

标签: url-rewriting

我尝试使我的网址友好:

https://xxxxx.com/imovel?apartamento-cangaíba-são+paulo-73+m²

https://xxxxx.com/imovel/apartamento-cangaíba-são+paulo-73+m²

需要将?更改为/

我的apache ssl文件配置是:

RewriteEngine On

                RewriteCond %{HTTPS} !on
                RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

                RewriteCond %{HTTP_HOST} ^33\.333\.33\.33$
                RewriteRule ^(.*)$ https://xxxxx.com [L,R=301]


                # To remove trailing slash
#               RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
#               RewriteRule ^(.*)/$ $1 [R=301,L]

                # To remove .php extension
                RewriteRule ^(.*)\.php$ $1 [R=301,L]

                # To check whether the file exists then set it back internally
                RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
                RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME}.php -f
                RewriteRule ^.*$ $0.php [L]

                #Seo imovel
                RewriteRule ^imovel/([a-z0-9-]+)/?$ /imovel?titulo=$1 [NC]

我现在只需要将?更改为/

在我的表格中:

<form id="f_det" method="post" action="imovel?<?php echo strtolower(urlencode($imovels->tipo_imob."-".$imovels->bairro_imob."-".$imovels->cidade_imob."-".$tam_m2));?>">

找不到我的错误。不要在最终网址上工作就像:

https://xxxxx.com/imovel?apartamento-cangaíba-são+paulo-73+m²

1 个答案:

答案 0 :(得分:0)

请更改您的操作网址? to imovel /,如下所示,

showPopup