Jump to content

Tobbe

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by Tobbe

  1. Hello!

    I am trying to use htaccess to remove the .html tag and the /folder/ from the URL. Spent hours on google trying to find something that works.

    If anyone could link me to a working example or help me would be extremely appreciated

    This is what I have right now:

    Options +FollowSymLinks -MultiViews
    # Turn mod_rewrite on
    RewriteEngine On
    RewriteBase /
    
    RewriteCond %{REQUEST_FILENAME}.html -f
    RewriteCond %{REQUEST_URI} !/$
    RewriteRule (.*) $1\.html [L]
    
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+pages/([^\s]+) [NC]
    RewriteRule ^ %1 [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule (?!^pages/)^(.*)$ /pages/$1 [L,NC]

    But it does not remove all of the html tags for some reason and I can still see the /folder/. Also I can't view the index file normally anymore it just looks like this:

    rfTDDrF.png

  2. <p>
    <h2>Greetings</h2>
    Text<br>
    <br>
    More text<br>
    <br>
    text <a href="link">Name<i class="material-icons" style="font-size:12px">open_in_browser</i></a> text<a href="link" target="_blank">Name<i class="material-icons" style="font-size:12px">open_in_new</i></a>?<br>
    <br>
    Text <a href="Link">Name<i class="material-icons" style="font-size:12px">open_in_browser</i></a><br>
    <br>
    Text<br>
    </p>

    I get this error: 

    Error: No p element in scope but a p end tag seen.

    From line 50, column 1; to line 50, column 4

    (validator.w3.org)

    Everything seems to work as it should but I get this error and can't figure out what is wrong

×
×
  • Create New...