.htaccess redirect my site gives internal error -


i trying first time make .htaccess file. @ start make redirect, if person writes:

https://example.com/robots.txt

the person redirected

https://example.com

i made file, , added following code:

redirect 301 https://example.com/robots.txt/ https://example.com/index.php 

i tried with:

redirectmatch 301 ^/bonus https://example.com/robots.txt redirectmatch 301 ^/ https://example.com/ 

which both resulted in site got internal error. how correct way that?

i'm not 100% sure why want direct away robots.txt file stop search engine crawlers accessing file... can using this:

redirect 301 /robots.txt /index.php 

or, try this:

redirect 301 /robots.txt https://www.example.com/ 

to rid of www use this:

rewriteengine on rewritecond %{http_host} ^www.example.com$ [nc] rewriterule ^(.*)$ http://example.com/$1 [r=301,l] 

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? -