1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Resolved HTML Needed

Discussion in 'General Internet' started by Dingus, 2016/10/12.

  1. 2016/10/12
    Dingus

    Dingus Well-Known Member Thread Starter

    Joined:
    2010/02/03
    Messages:
    109
    Likes Received:
    1
    Hi everyone.
    I have a website that's on WAMP.
    When I try to access a page it needs the page plus the .HTML at the end or it won't work.
    I did have this issue before on another site, but I fixed that by removing the .htaccess file, which wasn't needed.
    In this case there isn't one.
    Any idea folks?
     
  2. 2016/10/12
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    By Apache default, ALL pages will need the extension such as .html.
    So, to access contact.html the address must be abc.com/contact.html.

    A .htaccess file must be used so the extension is not needed using Apache mod_rewrite rules.
    examples:
    How to remove .php, .html, .htm extensions with .htaccess
     
    Last edited: 2016/10/12

  3. to hide this advert.

  4. 2016/10/13
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    Got a private message and responded with the below but changed the actual Website URLs because the site is not intended for public viewing from this forum.

     
  5. 2016/10/13
    Dingus

    Dingus Well-Known Member Thread Starter

    Joined:
    2010/02/03
    Messages:
    109
    Likes Received:
    1
    Thanks Tony.
    With http://*******.com/macros
    I still get :
    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator at admin@example.com to inform them of the time this error occurred, and the actions you performed just before this error.

    More information about this error may be available in the server error log.
     
  6. 2016/10/14
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    See the last 20 or so lines of the server error log, post here.
    Also, verify that the apache rewrite module is enabled.
    On WAMP you should have a tray icon for wampmanager.
    Click > Apache > Apache modules > enable mod_rewrite.
     
  7. 2016/10/14
    Dingus

    Dingus Well-Known Member Thread Starter

    Joined:
    2010/02/03
    Messages:
    109
    Likes Received:
    1
    Rewrite wasn't but now is enabled.

    WAMP error log:
    Wish I spoke double dutch

    [Fri Oct 14 14:58:35.001662 2016] [core:alert] [pid 12448:tid 1096] [client 66.249.73.185:41300] D:/wamp/www/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
    [Fri Oct 14 15:13:09.356741 2016] [core:alert] [pid 12448:tid 1096] [client 66.249.73.148:50978] D:/wamp/www/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
    [Fri Oct 14 15:50:00.564472 2016] [core:alert] [pid 12448:tid 1096] [client 180.76.15.17:55256] D:/wamp/www/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
    [Fri Oct 14 15:51:24.749333 2016] [core:alert] [pid 12448:tid 1096] [client 180.76.15.150:59747] D:/wamp/www/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
    [Fri Oct 14 16:21:04.332915 2016] [mpm_winnt:notice] [pid 13404:tid 676] AH00422: Parent: Received shutdown signal -- Shutting down the server.
    [Fri Oct 14 16:21:06.348794 2016] [mpm_winnt:notice] [pid 12448:tid 412] AH00364: Child: All worker threads have exited.
    [Fri Oct 14 16:21:06.473807 2016] [mpm_winnt:notice] [pid 13404:tid 676] AH00430: Parent: Child process 12448 exited successfully.
    [Fri Oct 14 16:21:09.114713 2016] [mpm_winnt:notice] [pid 4000:tid 652] AH00455: Apache/2.4.9 (Win64) PHP/5.5.12 configured -- resuming normal operations
    [Fri Oct 14 16:21:09.114713 2016] [mpm_winnt:notice] [pid 4000:tid 652] AH00456: Apache Lounge VC11 Server built: Mar 16 2014 12:42:59
    [Fri Oct 14 16:21:09.114713 2016] [core:notice] [pid 4000:tid 652] AH00094: Command line: 'd:\\wamp\\bin\\apache\\apache2.4.9\\bin\\httpd.exe -d D:/wamp/bin/apache/apache2.4.9'
    [Fri Oct 14 16:21:09.114713 2016] [mpm_winnt:notice] [pid 4000:tid 652] AH00418: Parent: Created child process 16924
    [Fri Oct 14 16:21:09.505380 2016] [mpm_winnt:notice] [pid 16924:tid 668] AH00354: Child: Starting 64 worker threads.
    [Fri Oct 14 16:21:38.930874 2016] [mpm_winnt:notice] [pid 4000:tid 652] AH00422: Parent: Received shutdown signal -- Shutting down the server.
    [Fri Oct 14 16:21:40.946711 2016] [mpm_winnt:notice] [pid 16924:tid 668] AH00364: Child: All worker threads have exited.
    [Fri Oct 14 16:21:40.962338 2016] [mpm_winnt:notice] [pid 4000:tid 652] AH00430: Parent: Child process 16924 exited successfully.
    [Fri Oct 14 16:21:42.806284 2016] [mpm_winnt:notice] [pid 8280:tid 632] AH00455: Apache/2.4.9 (Win64) PHP/5.5.12 configured -- resuming normal operations
    [Fri Oct 14 16:21:42.806284 2016] [mpm_winnt:notice] [pid 8280:tid 632] AH00456: Apache Lounge VC11 Server built: Mar 16 2014 12:42:59
    [Fri Oct 14 16:21:42.806284 2016] [core:notice] [pid 8280:tid 632] AH00094: Command line: 'd:\\wamp\\bin\\apache\\apache2.4.9\\bin\\httpd.exe -d D:/wamp/bin/apache/apache2.4.9'
    [Fri Oct 14 16:21:42.806284 2016] [mpm_winnt:notice] [pid 8280:tid 632] AH00418: Parent: Created child process 16656
    [Fri Oct 14 16:21:43.040684 2016] [mpm_winnt:notice] [pid 16656:tid 580] AH00354: Child: Starting 64 worker threads.
     
  8. 2016/10/14
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    Verify mod_rewrite is ON by checking the contents of httpd.conf for this:
    LoadModule rewrite_module modules/mod_rewrite.so
    there should not be a # in front of the line.

    Restart all the wamp services & you should be good to go. If still no joy try this in the .htaccess file: (and restart all wamp services)
    Code:
    Options +FollowSymLinks -MultiViews
    # Turn mod_rewrite on
    RewriteEngine On
    RewriteBase /
    
    ## hide .html extension
    # To externally redirect /dir/foo.html to /dir/foo
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.html [NC]
    RewriteRule ^ %1 [R,L,NC]
    
    ## To internally redirect /dir/foo to /dir/foo.html
    RewriteCond %{REQUEST_FILENAME}.html -f
    RewriteRule ^ %{REQUEST_URI}.html [L]
    
     
  9. 2016/10/14
    Dingus

    Dingus Well-Known Member Thread Starter

    Joined:
    2010/02/03
    Messages:
    109
    Likes Received:
    1
    I checked there was no #
    I then pasted your code. Now I don't need the .html
    Superb Tony. Probably simple to you, but it leaves me dumb founded.
    Cheers again
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.