I'm struggling with .htaccess a little.
I have routes in routes.php like for:
/category/{categorySlug}
/product/{productSlug}
/tag/{tagSlug}
I need to use even nicer urls that looks like:
some-category.c.html --> /category/{categorySlug}
iphone-7s.p.html --> /product/{productSlug}
samsung-galaxy.t.html --> /tag/{tagSlug}
It should not use redirect, only identify url pattern ant continue further to routing with remade url. It should stay as it is on browser.
I have tried something like this with various variations with RewriteRule ^(.*).c.html$ /category/$1 [NC] but no success (all other config is default that comes with fresh Laravel 5.5 install):
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Tried various flags...
RewriteRule ^(.*).c.html$ /category/$1 [NC]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
Thanks! :)
{categorySlug}.c.htmlinstead of/category/{categorySlug}?