Rewrite URL and server path from htaccess

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
truefriend-cz
Posts: 65
Joined: Jan 08, 2019 2:14 am

Rewrite URL and server path from htaccess

Post by truefriend-cz » Jan 17, 2019 7:20 am

I have problem with compatibility Mantis and .htaccess file for rewriting subdomain to directory

If have .htaccess in the root file for rewrite URL subdomain to directory:
My domain is http://bugs.domain.tld
and system path for Mantis is /etc/apache2/www/root/bugs

.htaccess:

Code: Select all

# subdomain to directory
RewriteCond %{HTTP_HOST} !^www\.domain\.tld$
RewriteCond %{HTTP_HOST} ^(\w+)\.domain\.tld$
RewriteCond %{REQUEST_URI}:%1 !^/([^/]+)/([^:]*):\1
RewriteRule ^(.*)$ /%1/$1 [QSA]
then on the webpage Mantis systemhave URLs for click ("a href" in html code) in format http://bugs.domain.tld/bugs/bug_report_page.php

i wanted domain in format http://bugs.domain.tld/bug_report_page.php

How i can removing bugs/ from URL?
Thanks
Mantis version: 2.19.0, OS: Windows, PHP: 7.3, Charset (PHP, Database): UTF-8, and: little, bad english

Post Reply