All i want to do is to rewrite url from www.exaple.hu to www.exaple.cz/hu. So under address www.exaple.cz/hu is displayed content from adress www.exaple.hu.
So when user type www.exaple.cz/hu, user is not redirected to www.exaple.hu but content from www.exaple.hu is displayed under domain www.exaple.cz/hu (so in adress bar is www.exaple.cz/hu).
You will need to enable mod_proxy in your Apache config for that. Once mod_proxy is enabled, enable mod_rewrite and .htaccess through httpd.conf
and then put this code in your .htaccess
under DOCUMENT_ROOT
directory:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.exaple\.cz$ [NC]
RewriteRule ^(hu)/?$ http://www.exaple.$1 [L,P,NC]
Are the files for www.exaple.cz/hu and www.exaple.hu on the same server?
If yes, I would create a symbolic link so that www.exaple.cz/hu content directory is pointing to www.exaple.hu content directory.
For example if server A has directores:
cd /var/www/html/
ln -s /var/www/html/B A
this way, you only have one source but link ways to get to the source.
If the two URLs are pointing to two diff servers, you can try mounting the two and using the slink Or.. include "www.exaple.hu" as a frame in www.exaple.cz/hu?
If the files are on the same server, you may delete the add-on domain in (cpanel) and re-add the domain but this time select the other domain's working directory.
If the link structure of your domain is like:
<a href="/path/page">Link</a>
You can use the new site now without any problems.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With