0

I have two websites. One is a Django App. The other is just a static site.

If someone were to submit https://example.com/more_info

I need to redirect them to https://example.co/more_info

Note the .com vs .co

But if they just request https://example.com then I serve them the index page.

I've unsuccessfully tried the code below in my .htaccess file:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^(|/)$
Rewriterule (.*) https://example.com/$1
crappy_hacker
  • 191
  • 3
  • 6
  • Does this answer your question? [.htaccess redirect all pages except the home page](https://stackoverflow.com/questions/38594507/htaccess-redirect-all-pages-except-the-home-page) – Example person Mar 17 '20 at 09:40

1 Answers1

1

I think you want to redirect every page to https://example.co other than the home/index page. You can do this by:

RewriteEngine On
RewriteRule (.+) https://example.co/$1 [R=301,L,NE]
Example person
  • 3,198
  • 3
  • 18
  • 45