1

I have written this code in .htaccess

RewriteEngine on
RewriteRule ^signin signin.php

But when I am trying to make link like <a href="signin">Xyz </a>

It showing me this error:

Not Found The requested URL /abctra/signin was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

What could be the problem is it a problem of hosting I am using Godaddy Linux hosting. If any changes needed to be done on the server do tell me.

The code is running on the localhost nicely. Just not running on the hosting account.

halfer
  • 19,824
  • 17
  • 99
  • 186
Rishap Gandhi
  • 364
  • 1
  • 11
  • Are you sure there is a `signin.php` file in that folder? – Howli Mar 28 '14 at 10:37
  • can you show your .htaccess code? – sunny Mar 28 '14 at 10:37
  • and what url you are getting after writing this in .htaccess? – sunny Mar 28 '14 at 10:39
  • Where do you have the .htaccess file? On the folder /abctra ? – Lepanto Mar 28 '14 at 10:43
  • abctra.com is the link you can check it i have just uploaded a demo on it. Either click on Signin or on Register its giving same problem. – Rishap Gandhi Mar 28 '14 at 10:47
  • Ricoxor just using simple PHP – Rishap Gandhi Mar 28 '14 at 10:48
  • Lepanto -> abctra is my hosting folder i have just placed the .htaccess in the folder – Rishap Gandhi Mar 28 '14 at 10:49
  • There is no issue with what you have in .htaccess, Rishap, I think signin.php has some issue. I think you have used an wrong path. Check the code. – Lepanto Mar 28 '14 at 10:54
  • Lepanto this code is correct the same code is running one my other hosting account of big rock linux server. Its not working on Godaddy. Thats why i have mentioned my hosting server name. may be any changes needed to be made in the settings of Godaddy – Rishap Gandhi Mar 28 '14 at 10:56
  • abctra.com/signin.php is showing an error, did you check that? It is this error explained on a different manner when you try abctra.com/signin – Lepanto Mar 28 '14 at 10:59
  • Check In the Apache ERROR LOGS – sunny Mar 28 '14 at 11:05
  • Lepanto i am rewriting the url from abctra.com/signin.php to abctra.com/signin so if u will try to open abctra.com/signin.php it will give error. – Rishap Gandhi Mar 28 '14 at 11:11
  • I know that you are trying to use abctra.com/signin which will run the code that is in abctra.com/signin.php. But I'm sure there is issue with signin.php and not in htaccess. I hope you have PHP header redirection in signin.php which is pointing to an incorrect path. – Lepanto Mar 28 '14 at 11:25
  • No its is opening the abctra.com/signin.php – Rishap Gandhi Mar 28 '14 at 11:36
  • Can you create a file called `info.php` with this code `` and then open `http://abctra.com/info.php` to check what is its `DOCUMENT_ROOT` value. – anubhava Mar 28 '14 at 11:37
  • Anubhava -> its showing two path one for the main domain and other for subdomain. and abctra path is showing in the subdomain /var/chroot/home/content/73/7312973/html/abctra. You and also check the link [link]http://abctra.com/info.php – Rishap Gandhi Mar 28 '14 at 11:47
  • What to do with DOCUMENT_ROOT? – Lepanto Mar 28 '14 at 11:53
  • I am not getting the solution guys its really very urgent for me... Have to upload the website by tomorrow.. the code is running on the localhost nicely. Just not running on the hosting account. – Rishap Gandhi Mar 28 '14 at 12:13

2 Answers2

0

I think your code looks fine try to check if mod_rewrite Apache module is enabled, with shared hosting you might not have SSH access but you can check it via php using the below code

in_array('mod_rewrite', apache_get_modules());
opensource-developer
  • 2,826
  • 4
  • 38
  • 88
0

You almost had, the following should work:

RewriteEngine on
RewriteRule ^signin$ /signin.php
Howli
  • 12,291
  • 19
  • 47
  • 72