redirect - Redirection of single pages to another page - .htaccess -



redirect - Redirection of single pages to another page - .htaccess -

i tried different redirects 1 page (page moved url) nil working - maintain getting 404 page.

i move http://www.staskka.com/mladinska-postelja-gasilec.html http://www.staskka.com/otroska-oprema/otroske-posteljice/mladinska-otro%c5%a1ka-postelja-gasilec.html

nothing happens. still 404 page not found.

code in .htaccess was:

# begin permanent url redirects rewriterule ^mladinska-postelja-gasilec\.html$ /pohistvo/otroske-posteljice/mladinska-otroška-postelja-gasilec/? [l,r=301,nc]

i have redirection non www www.. , works fine..

rewritecond %{http_host} !^www\. rewriterule ^(.*)$ http://www.%{http_host}/$1 [r=301,l]

i need redirect of url's because set them in category , lot of sites ranked on google well-- help me out, please?

your help much appreciated .. thanks.

oh, , utilize oc 1.5.1.3.

edit: whole .htaccess

rewriteengine on rewritecond %{http_host} ^www.djecje-kuhinje.com$ [or] rewritecond %{http_host} ^djecje-kuhinje.com$ rewriterule ^djecje-kuhinje-com\/ "http\:\/\/shop\.djecje-kucice\.com\/" [r=301,l] #52b5421b82424 rewritecond %{http_host} ^www.otroska-kuhinja.si$ [or] rewritecond %{http_host} ^otroska-kuhinja.si$ rewriterule ^otroska-kuhinja\/ "http\:\/\/www\.otroskekuhinje\.si\/" [r=301,l] #51f13a48f336e rewritecond %{http_host} ^kidkraft.staskka.com$ rewriterule ^kidkraft\/ "http\:\/\/www\.staskka\.com\/" [r=301,l] #50f3d3a25618d rewritecond %{http_host} !^www\. rewriterule ^(.*)$ http://www.%{http_host}/$1 [r=301,l] rewritecond %{http_user_agent} libwww-perl.* rewriterule .* – [f,l] ##begin mobile (do not edit below line) rewritebase / ##end mobile rewriterule test\.htm http://www.google.com [r] rewritecond %{http_user_agent} ((.*iphone.*)|(.*ipod.*)|(.*blackberry.*)|(.*android.*mobile.*)|(.*windows\ ce.*)|(.*iemobile.*)|(.*opera\ mini.*)|(.*opera\ mobi.*)) rewritecond %{http_cookie} !dm_show_classic rewritecond %{query_string} !no_redirect=true [nc] rewritecond %{http_host} ^www\. [nc,or] rewritecond %{http_host} ^[0-9a-z-]+\.[a-z]+$ [nc] rewritecond %{request_uri} ^/_dm/s/ [nc,or] rewritecond %{request_filename} !\.(jpg|gif|png|css|js|txt|ico|pdf|bmp|tif|mp3|wav|wma|asf|mp4|flv|mpg|avi|csv|doc|docx|xls|xlsx|ppt|pptx|zip|rar|tar|gz|dmg|iso)$ [nc] rewriterule ^(.*)$ http://mobile.staskka.com/ [r,l] rewriterule ^sitemap.xml$ index.php?route=feed/google_sitemap [l] rewriterule ^googlebase.xml$ index.php?route=feed/google_base [l] rewriterule ^download/(.*) /index.php?route=error/not_found [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_uri} !.*\.(ico|gif|jpg|jpeg|png|js|css) rewriterule ^([^?]*) index.php?_route_=$1 [l,qsa] # compress text, html, javascript, css, , xml addoutputfilterbytype deflate text/plain addoutputfilterbytype deflate text/html addoutputfilterbytype deflate text/xml addoutputfilterbytype deflate text/css addoutputfilterbytype deflate application/xml addoutputfilterbytype deflate application/xhtml+xml addoutputfilterbytype deflate application/rss+xml addoutputfilterbytype deflate application/javascript addoutputfilterbytype deflate application/x-javascript # remove browser bugs browsermatch ^mozilla/4 gzip-only-text/html browsermatch ^mozilla/4\.0[678] no-gzip browsermatch \bmsie !no-gzip !gzip-only-text/html header append vary user-agent ## expires caching ## <ifmodule mod_expires.c> expiresactive on expiresbytype image/jpg "access plus 1 week" expiresbytype image/jpeg "access plus 1 week" expiresbytype image/gif "access plus 1 week" expiresbytype image/png "access plus 1 week" expiresbytype text/css "access plus 1 week" expiresbytype application/pdf "access plus 1 week" expiresbytype text/x-javascript "access plus 1 week" expiresbytype application/x-shockwave-flash "access plus 1 week" expiresbytype image/x-icon "access plus 1 week" expiresdefault "access plus 1 week" </ifmodule> ## expires caching ## <ifmodule mod_gzip.c> mod_gzip_on yes mod_gzip_dechunk yes mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$ mod_gzip_item_include handler ^cgi-script$ mod_gzip_item_include mime ^text/.* mod_gzip_item_include mime ^application/x-javascript.* mod_gzip_item_exclude mime ^image/.* mod_gzip_item_exclude rspheader ^content-encoding:.*gzip.* </ifmodule> # begin permanent url redirects rewriterule ^mladinska-postelja-gasilec\.html$ /pohistvo/otroske-posteljice/mladinska-otroška-postelja-gasilec/? [l,r=301,nc] rewritecond %{script_filename} !-s rewriterule (.*) index.php?path=$1 [qsa,l]

from notice in code problem lies here:

rewriterule ^([^?]*) index.php?_route_=$1 [l,qsa]

since having l flag, means after url phone call server processes , ends there, meaning whatever write after if url caught in conditions above stop there.

so in specific case need add together (notice thesame without l flag need opencart process afterwards):

rewriterule ^mladinska-postelja-gasilec\.html$ /pohistvo/otroske-posteljice/mladinska-otroška-postelja-gasilec/? [r=301,nc]

after line

rewritecond %{http_user_agent} libwww-perl.* rewriterule .* – [f,l]

let me clarify not if code utilize 1 matches behavior want to. position right one. since in comment stated need add together these rules @ end, handling external domains mostly, case (internal url handling) way accomplish it.

.htaccess redirect http-status-code-404 opencart http-status-code-301

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -