Answer the question
In order to leave comments, you need to log in
How to fix .htaccess to remove news from url?
In cms, all news opens with a predefined category news
.htaccess
RewriteRule ^news/(.*)/(.*)$ news.php?id=$1&slug=$2How to remove news?
RewriteRule ^(.*)/(.*)$ news.php?id=$1&slug=$2works, but now 404 error doesn't work (performs permanent redirects), its code is in .htaccess
RewriteRule ^not-found$ notfound.php
DirectoryIndex index.php
AddDefaultCharset UTF-8
<ifModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^category/(.*)/(.*)$ category.php?id=$1&slug=$2
RewriteRule ^source/(.*)/(.*)$ source.php?id=$1&slug=$2
RewriteRule ^(.*)-(.*)$ news.php?id=$1&slug=$2
RewriteRule ^page/(.*)/(.*)$ page.php?id=$1&slug=$2
RewriteRule ^search/(.*)$ search.php?q=$1
RewriteRule ^not-found$ notfound.php
RewriteRule ^rss.xml$ rss.php
RewriteRule ^sitemap-(.*).xml$ sitemap.php?id=$1
RewriteRule ^categories-sitemap.xml$ categories-sitemap.php
</ifModule>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question