.htaccess redirect all sub directories under sub directory -
i want redirect sub directories under sub directory root/windows/
root/windows/ct.php
file structure of site like
root/windows/ct.php
redirect these type of url
http://www.site.com/windows/games/ or http://www.site.com/windows/games http://www.site.com/windows/software/ or http://www.site.com/windows/software
to
http://www.site.com/windows/ct.php?ct=games http://www.site.com/windows/ct.php?ct=software
i trying redirects url sub directory root/windows/ct.php
rewriterule ^([^/]*)/ /site/windows/?ct=$1 [l] rewriterule ^([^/windows]*)/ /site/windows/?ct=$1 [l] // 1 shows internal server error
complete .htaccess code
options +followsymlinks rewriteengine on <ifmodule mod_rewrite.c> rewriterule ^(error) - [l] rewriterule ^[^/]*/[^/]*/(.*\.html) /site/error/400/ [l] rewriterule ^([^/]*)/(.*\.html) /site/software/?link=$1&id=$2 [l] rewriterule ^([^/]*)/ /site/windows/?ct=$1 [l] rewriterule ^sitemap\.xml$ sitemap.php [l] rewriterule ^rss/(.*?)\.xml$ rss/$1.php [l] </ifmodule> errordocument 400 /site/error/400/
i not know .htaccess please see , suggest possible way it. thanks.
give try:
<ifmodule mod_rewrite.c> options +followsymlinks -multiviews rewriteengine on rewritebase / rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^windows/([^/]+)/?$ /windows/ct.php?ct=$1 [l] </ifmodule>
for localhost
use one:
<ifmodule mod_rewrite.c> options +followsymlinks -multiviews rewriteengine on rewritebase /site/ rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^windows/([^/]+)/?$ windows/ct.php?ct=$1 [nc,l] </ifmodule>
Comments
Post a Comment