Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Sep 2011
    Posts
    104
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Need to to run web application on local environment

    Hi All,

    I don't have information about how .htaccess is works. I have below script in my .htaccess. This web I downloaded from live now I need to run it on local environment (localhost). I have windows and xampp I already configured db for this web application but because of .htaccess the web application is not working when I execute application it redirects to "http://www.localhost/xampp/" please help to resolve the issue I will be very thank full.

    Application address: http://www.localhost/abc

    PHP Code:
    RewriteEngine on
    RewriteCond 
    %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
    RewriteBase 
    ##RewriteRule ^index.html$ home [L,NC]
    RewriteRule ^homeindex.php?pageid=91
    RewriteRule 
    ^homehttp://www.abc.com/Home
    Redirect /index.html http://www.abc.com/home
    RewriteRule ^home$ /index.php?pageid=91
    RewriteRule 
    ^products$ /product-details.php?pageid=92&ID=2
    RewriteRule 
    ^services$ /subpage.php?pageid=94
    RewriteRule 
    ^SOLUTIONS$ /subpage.php?pageid=105
    RewriteRule 
    ^ABOUT-US$ /subpage.php?pageid=113
    RewriteRule 
    ^contact$ /contact.php?pageid=115
    RewriteRule 
    ^contact$ /contact.php?pageid=115&webtolead=1
    RewriteRule 
    ^customer-relationship-management$ /solutions.php?pageid=116
    RewriteRule 
    ^enterprise-mobility-management$ /solutions.php?pageid=117
    RewriteRule 
    ^application-performance-management$ /solutions.php?pageid=118
    RewriteRule 
    ^quantum-mes$ /solutions.php?pageid=129
    RewriteRule 
    ^consulting$ /solutions.php?pageid=119
    RewriteRule 
    ^implementation$ /solutions.php?pageid=120
    RewriteRule 
    ^support$ /solutions.php?pageid=121
    RewriteRule 
    ^Company-Overview$ /subpage.php?pageid=122
    RewriteRule 
    ^President-Message$ /subpage.php?pageid=123
    RewriteRule 
    ^Clients$ /clients.php?pageid=124
    RewriteRule 
    ^News$ /news.php?pageid=125&page=0
    RewriteRule 
    ^Careers$ /careers.php?pageid=126
    RewriteRule 
    ^sitemap$ /sitemap.php?pageid=128
    RewriteRule 
    ^--Pivotal-CRM$ /product-details.php?pageid=92&ID=2
    RewriteRule 
    ^Sugar-CRM$ /product-details.php?pageid=92&ID=3
    RewriteRule 
    ^Airwatch-EMM$ /product-details.php?pageid=92&ID=5
    RewriteRule 
    ^Compuware-APM$ /product-details.php?pageid=92&ID=6
    RewriteRule 
    ^IStorage$ /product-details.php?pageid=92&ID=7
    RewriteRule 
    ^Astute-Solutions$ /product-details.php?pageid=92&ID=9
    RewriteRule 
    ^MS-Dynamicshttp://www.abc.com/products
    RewriteRule ^Test-Product$ /product-details.php?pageid=92&ID=10 

    RewriteRule 
    ^News-([0-9]+)$ /news-details.php?pageid=125&id=$1
    RewriteRule 
    ^NEWS-([0-9]+)$ /news.php?pageid=125&page=$1
    RewriteRule 
    ^Careers-([0-9]+)$ /job-details.php?pageid=126&id=$1
    RewriteRule 
    ^CAREERS-([0-9]+)$ /job-details.php?pageid=126&page=$1

    <IfModule mod_expires.c>
    ExpiresActive On
    ############################################
    ## Add default Expires header
    ## http://developer.yahoo.com/performance/rules.html#expires
    <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
     
    ExpiresDefault "access plus 1 week"
    </FilesMatch>
    </
    IfModule>
    <
    IfModule mod_headers.c>
    Header unset ETag
    Header 
    unset Last-Modified
    </IfModule>
    FileETag None
    <FilesMatch "\.(ico|gz|JPG|jpg|jpeg|png|gif|js|css|swf)$">
    Header unset Cache-control
    Header set Expires 
    "access plus 1 week"
    </FilesMatch

  2. #2
    Administrator VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    10,556
    Thanks
    6
    Thanked 1,245 Times in 1,215 Posts
    First thing you should do is comment out lines 2 and 3 (put a ‘#’ at the beginning of the line to comment it out). That’s responsible for the redirect from domains without the “www” subdomain to the (redundant!) subdomain – which you don’t have and don’t need on localhost. Then there’s a lot of other junk in there of which I don’t know whether that’s even necessary; but wherever you have “http://www.abc.com” in a line, comment that out, too.


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •