Home .htaccess subdomain Rewrite rule is not working
Reply: 0

.htaccess subdomain Rewrite rule is not working

user916
1#
user916 Published in May 27, 2018, 3:38 am

I am making a website builder an I would like to make urls prettier.

The url would be for example:

https://ccc-bb.example.com => https://example.com/project/show/ccc/bb

This is my .htaccess file:

<IfModule mod_rewrite.c>
RewriteEngine On
# prevents files starting with dot to be viewed by browser
RewriteRule /\.|^\.(?!well-known/) - [F]

# front controller
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\-(.*)$ https://example.com/project/show/$1/$2 [L]

When I use above (https://ccc-bb.example.com) it sends me to the subdomain empty folder. The folder has only the .htaccess file.

What am I missing? I've never edited an .htaccess file and Google didn't help me (or I don't know what should I looking for).

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.307713 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO