Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Update: I have updated the file, I did comment that I was getting a 500 server error, but I don't know if that is was just a passing thing or if something in my .htaccess messed things up! Anyway this is the file I am now using and this works, by that no more 500 error but still will not keep me on my localhost, vaio-server but keeps transferring me to my live site!

Any Ideas?? Please??

 DirectoryIndex index.php index.html

 # Upload sizes
 php_value upload_max_filesize 25M
 php_value post_max_size 25M
 # Avoid folder listings
 Options -Indexes

<IfModule mod_rewrite.c>
  # Redirect everyone but from visualhouse office
  Options +FollowSymlinks
  RewriteEngine on
  RewriteBase /

  # Maintenance
  #RewriteCond %{REQUEST_URI} !/maintenance.html$
  #RewriteCond %{REMOTE_ADDR} !(^127\.0\.1\.1)
  #RewriteRule $ /maintenance.html [R=302,L]

  #Redirects to www
  RewriteCond %{HTTP_HOST} !^vaio-server [NC]
  #RewriteCond %{HTTPS}s ^on(s)|off
      #RewriteCond %{REMOTE_ADDR} 127\.0\.1\.1 
  RewriteRule ^(.*)$ http://vaio-server/$1 [R=301,QSA,L]

  #Empty string
  #RewriteCond %{REMOTE_ADDR} (^127\.0\.1\.1)
  RewriteRule    ^$ app/webroot/    [L]
  #RewriteCond %{REMOTE_ADDR} (^127\.0\.1\.1)
  RewriteRule    (.*) app/webroot/$1 [L]
</IfModule>

I am hoping you can help me! Below is my .htaccess files for my Apache server running on top of Ubuntu server. This is my local server which I installed so I can develop my site on this instead of using my live site! However i have all my files and the database on my localhost now but each time I access my server, vaio-server (its a sony laptop), it just takes me to my live site! Now eveything is in the root of Apache, /var/www - its the only site I will develop on this system so I don't need to config this to look at any many than this one site!

I think thats all, all the Apache files, site-available/default ect are as standard. - Please Help!!

Many Thanks

Glenn Curtis.

 DirectoryIndex index.php index.html

  # Upload sizes
  php_value upload_max_filesize 25M
  php_value post_max_size 25M
  # Avoid folder listings
  Options -Indexes

 <IfModule mod_rewrite.c>
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /

    # Maintenance
    #RewriteCond %{REQUEST_URI} !/maintenance.html$
    #RewriteRule $ /maintenance.html [R=302,L]

    #Redirects to www
    #RewriteCond %{HTTP_HOST} !^vaio-server [NC]
    #RewriteCond %{HTTPS}s ^on(s)|off
    #RewriteRule ^(.*)$ glenns-showcase.net/$1 [R=301,QSA,L]

    #Empty string
    RewriteRule    ^$ app/webroot/    [L]
    RewriteRule    (.*) app/webroot/$1 [L]
 </IfModule>
share|improve this question
    
Umm, I am not sure why but I just restarted my Apache and now I get a server 500 error??? –  Glenn Curtis Jul 11 '12 at 13:42
    
If you're using Linux, have you tried to run apache2ctl configtest to check for the Server Error? And don't forget to check the logs too. –  Lukas Jul 11 '12 at 14:19
    
I am sure its not a server error, although its just plain stupid to rule something out!! And no I didn't know you could do that configtest. I have no run it, this is what I get -> –  Glenn Curtis Jul 11 '12 at 14:39
    
apache2 : Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName Syntax OK I think that means, Syntax is ok so the server should run? –  Glenn Curtis Jul 11 '12 at 14:46
    
Yes, but I'm not entirely sure whether it checks the .htaccess Files as well. I'd have a look in the Logfile, typically /var/log/apache/error.log. This concerns your Server Error, not the redirect issue... –  Lukas Jul 11 '12 at 14:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.