Domain name rewriting and URL rewriting in the meantime in .htaccess
- by Steven
Ugly URLs:
www.domainname.com/en/piece/piece.php?piece_id=1
www.domainname.com/en/piece/piece.php?piece_id=2
www.domainname.com/en/piece/piece.php?piece_id=3
...
Friendly URLs:
piece.domainname.com/en/1
piece.domainname.com/en/2
piece.domainname.com/en/3
...
I want to present website users only friendly URLs.
When I apply
RewriteEngine On
RewriteRule ^en/([^/]*)$ /en/piece/piece.php?piece_id=$1 [L]
only the URL is rewrote.Besides the CSS file can not be found in web page of the friendly URL. How to rewrite the domain name and the URL in the meantime?
Do I have to use RedirectMatch, if so, how to do it?