.htaccess - htaccess redirect everything on domain to a single page -


i'm attempting replace entire website single landing page on different domain. of following domains:

example.com www.example.com example.com/page-1 example.com/sub/page-2.html 

should redirect to:

new-domain.com/landing-page 

currently, i'm using following .htaccess file (no other content in file):

rewriteengine on rewritecond %{http_host} ^(www.)?example.com$ rewriterule ^(.*)$ http://new-domain.com/landing-page/ [r=301,l] 

additional details:

  • i'm set on godaddy deluxe linux hosting package.
  • example.com "primary" domain of package, not addon domain. default directs root of server space (this .htaccess file in root).
  • i have several other addon domains, redirecting traffic server not option.
  • new-domain.com hosted on same server space addon domain.

the problem i'm running example.com redirecting new-domain.com - not new-domain.com/landing-page. other example urls listed above redirect intended.

any ideas why non-www domain base wont redirect subpage?

it seems caching issue. tried in firefox , redirect works correctly in cases. went chrome, cleared cache , worked well.

apparently, .htaccess 301 redirects may cashed.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -