2017-03-06 5 views
1

Ich habe sajjanlamichhane.com Website gehostet auf Amazon EC2. Aber meine eigentliche Website ist in sajjanlamichhane.com/wp/. Also, URL umleiten, aber ich möchte die Weiterleitungs-URL maskieren. Wie mache ich das? Ich habe dies unterURL Umleitung und Neuformatierung gleichzeitig

Listen 80 
<VirtualHost *:80> 
ServerAdmin [email protected] 
ServerName sajjanlamichhane.com 
ServerAlias www.sajjanlamichhane.com 
DocumentRoot /var/www/sajjanlamichhane.com/ 
ErrorLog /var/www/sajjanlamichhane.com/logs/error.log 
CustomLog /var/www/sajjanlamichhane.com/logs/access.log combined 
Redirect http://sajjanlamichhane.com "http://sajjanlamichhane.com/wp/ 
RewriteEngine on 
RewriteRule ^/$ http://sajjanlamichhane.com/wp/index.php [R=301,NC,L] 
# remove www 
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] 
RewriteRule^http://%1%{REQUEST_URI} [NE,R=301,L] 
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ 
RewriteRule !^wp/ /wp%http://sajjanlamichhane.com [L] 
</VirtualHost> 

Antwort

2

Dies ist, wie Sie lösen. Weitere Links zum Lesen: http://www.willmaster.com/library/web-development/url-masking.php

Listen 80 

<VirtualHost *:80> 

    ServerAdmin [email protected] 
    ServerName sajjanlamichhane.com 
    ServerAlias www.sajjanlamichhane.com 
    DocumentRoot /var/www/sajjanlamichhane.com/ 
    ErrorLog /var/www/sajjanlamichhane.com/logs/error.log 
    CustomLog /var/www/sajjanlamichhane.com/logs/access.log combined 
    Redirect http://sajjanlamichhane.com "http://sajjanlamichhane.com/wp/ 
    RewriteEngine on 
    RewriteCond http://sajjanlamichhane.com/wp/index.php http://sajjanlamichhane.com/wp/index.php$ 
    RewriteRule .* /wp/index.php [L] 



</VirtualHost>