***** NOT A TEACHER *****
Hello, Sahil Dhankhar:
According to Michael Swan in his Practical English Usage, both sentences are correct and mean the same.
Mr. Swan gives these examples [emphasis is mine]:
1. Jane's had a rather good idea."
2. Jane's had rather a good idea."
According to my dictionaries, "rather" is parsed (analyzed) as an adverb in both sentences.
According to Webster's Dictionary of English Usage, most authors seem to prefer the word order of sentence #1.
Student or Learner