This may be a silly question, but if I only have access to edit a website through a CMS, and can't touch the headers, is there a way to redirect the page without prompting the user to click a link?


You can use JavaScript to redirect them with code in the <body> of the page. It won't be a 301 redirect, however, as you can only do that with HTTP headers.

<script type="text/javascript">
window.location = "http://www.example.com/"
| improve this answer | |
  • perfect. I figured it would have to be js. Thanks! – RCNeil Dec 8 '11 at 18:06

Depends what is the objective.

If it is a permanent, it is better creating a .htaccess file with

Redirect /what http://some.tld/where

| improve this answer | |
  • 1
    They said they only have access to the website through a CMS. That would imply they cannot upload or create a .htaccess file. – John Conde Dec 8 '11 at 20:17
  • 1
    Indeed. I don't have FTP access to anything so modifying a .htaccess file is out of the question. The JS redirect works good. Thank you for your answer, though. – RCNeil Dec 9 '11 at 13:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.