0

I have a 301 redirect in place for a domain, however I am wanting to be able to access one page/file. How am I able to not include one specific file.

This is what I have now:

redirect 301 / https://example.com/
RedirectPermanent /  https://example.com

I am wanting to not include https://example.com/administrator

Paul
  • 3,348
  • 5
  • 32
  • 76
  • What kind of web server are you using and with what did you create this redirect? – rrr Aug 06 '18 at 18:58
  • Dedicated server. I used the .htaccess file. – Paul Aug 06 '18 at 18:59
  • excuse me I did not see the tags – rrr Aug 06 '18 at 18:59
  • In that case, though, the question is a [duplicate](https://stackoverflow.com/questions/3414015/redirect-site-with-htaccess-but-exclude-one-folder) – rrr Aug 06 '18 at 19:00
  • @rpi I saw that question. I am not wanting to exclude an entire folder, but only one file. – Paul Aug 06 '18 at 19:02
  • you can rewrite the answer by removing the part about the slash. Then `http://example.com/administrator` wouldn't be redirected, but `http://example.com/administrator/` would – rrr Aug 06 '18 at 19:04
  • @rpi Sorry, not entirely sure what you are saying to do. – Paul Aug 06 '18 at 19:13
  • Please look [here](https://stackoverflow.com/questions/30911687/how-can-i-htaccess-301-redirect-all-pages-files-except-for-one-to-new-domain) – rrr Aug 06 '18 at 19:14
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/177516/discussion-between-rpi-and-paul). – rrr Aug 06 '18 at 19:14
  • @Rpi I believe my internet settings are blocking the chat (I'm on a work computer) – Paul Aug 06 '18 at 19:17
  • Please check out the URL I wrote in [this](https://stackoverflow.com/questions/51713997/redirect-entire-site-except-for-one-file-with-htaccess#comment90389885_51713997) comment – rrr Aug 06 '18 at 19:18
  • So this? `RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$ [NC] RewriteCond %{THE_REQUEST} !/administrator [NC] RewriteRule ^ http://new.com%{REQUEST_URI} [L,R=301,NE]` – Paul Aug 06 '18 at 19:29
  • 1
    that would work – rrr Aug 06 '18 at 19:31

0 Answers0