snipt

Ctrl+h for KB shortcuts

Text only

Quitar el .html de las urls por htaccess

1
2
3
#### Para quitar el .html de las urls
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*\.html\ HTTP/
RewriteRule ^(.*)\.html$ /$1 [R=301,L]

Description

Para quitar el .html de toda url por htaccess
https://snipt.net/embed/ecacb9d931e0410ca9d5e738019a210a/
/raw/ecacb9d931e0410ca9d5e738019a210a/
ecacb9d931e0410ca9d5e738019a210a
text
Text only
3
2019-07-23T11:18:26
True
False
False
Sep 30, 2015 at 10:01 AM
/api/public/snipt/141324/
quitar-el-html-de-las-urls-por-htaccess
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>#### Para quitar el .html de las urls </span><span id="L-2"><a name="L-2"></a>RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*\.html\ HTTP/ </span><span id="L-3"><a name="L-3"></a>RewriteRule ^(.*)\.html$ /$1 [R=301,L] </span></pre></div> </td></tr></table>
htaccess, url
1
2
3
4
5
6
--- 
+++ 
@@ -0,0 +1,3 @@
+#### Para quitar el .html de las urls
+RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*\.html\ HTTP/
+RewriteRule ^(.*)\.html$ /$1 [R=301,L]
  • gaston
  • 3 years, 9 months ago