.htaccess rewrite remove directory name from request -
i trying make redirect request [http://test.site.com/pagename--city/] [http://test.site.com/state/pagename--city/] , [http://test.site.com/pagename--city/]. 'state/pagename--city' physical directories on server. if clicks on [http://test.site.com/pagename--city/] need execute [http://test.site.com/state/pagename--city/index.php] url remain [http://test.site.com/pagename--city/]. appreciated. thnx.
.htaccess file
options +followsymlinks rewriteengine on rewritebase / rewritecond %{request_uri} /(.*)--(.*)/?$ rewritecond %{request_uri} !/state/ rewriterule .* http://%{http_host}/state%{request_uri} [l] rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewritecond %{request_filename} !-l rewriterule .* page.php?&[|]v1||%{request_uri}[|]v2||-[|]v3||%{http_host}[|]v4||%{request_filename}[|]v5||eol[~|~]= [qsa,l]
rewriterule ^(.*)--(.*)$ /state/$1--$2/index.php&%{query_string} [l]
Comments
Post a Comment