Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

hiding the content path{request URI}

Avatar

Level 5

Hi Team,

when we hit the dispatcher http://mahesh.com  --> it is routing to http://mahesh.com/geohome.html  --> is this a normal scenerio?

We have put a rewrite rule:-

RewriteRule   ^/geohome.html$    http://mahesh.com/content/mahesh/index.html  [R=301,L]

Now we have a requirement, when ever user hits our domain name http://mahesh.com it should show the content of "http://<IP>/content/mahesh/index.html"

but in the browser it should stay at http://mahesh.com 

/content/mahesh/index.html --> this should be hidden.

Thanks,

viki

9 Replies

Avatar

Employee Advisor

Hi,

I guess, that the documentation at [1] shows in a much broader scenario, how you can implement your requirement.

kind regards,
Jörg

[1] https://docs.adobe.com/docs/en/dispatcher/disp-domains.html

Avatar

Level 5

Hi Jorg,

To be specific.

When ever the user hits http://mahesh.com , URL should stay same http://mahesh.com and it should the content of /content/siteb/$1.html

 

one more Question is:-

 

when i hit the domain name y it is getting routed to /geohome.html(i have uninstalled Geometrix package) but still, rather than our site home page /content/siteb/$1.html.

 

anywhere we can do configuration so that it goes to /content/siteb/$1.html.

 

Thanks,

Viki

Avatar

Employee Advisor

IIRC this is a property on the root node.

Jörg

Avatar

Level 2

Hi Mahesh,

Can you check your config manager(http://localhost:4502/system/console/configMgr) for "Day CQ Root Mapping". I guess Target Path is given as geohome.html, Try changing it if that is the case and let me know if it is working fine.

Avatar

Level 10

Mahesh Vikram wrote...

Hi Team,

when we hit the dispatcher http://mahesh.com  --> it is routing to http://mahesh.com/geohome.html  --> is this a normal scenerio?

We have put a rewrite rule:-

RewriteRule   ^/geohome.html$    http://mahesh.com/content/mahesh/index.html  [R=301,L]

Now we have a requirement, when ever user hits our domain name http://mahesh.com it should show the content of "http://<IP>/content/mahesh/index.html"

but in the browser it should stay at http://mahesh.com 

/content/mahesh/index.html --> this should be hidden.

Thanks,

viki

 

 

 

add one more rule 

RewriteRule   ^$    http://mahesh.com/content/mahesh/index.html  [PT,L]

Avatar

Level 5

we have put this rules in sequence.. but it is going to redirect loop.

 

RewriteRule   ^/geohome.html$    http://mahesh.com/content/mahesh/index.html  [R=301,L]

RewriteRule   ^$    http://mahesh.com/content/mahesh/index.html  [PT,L]

 

we tried this rule, it worked as expected.:-

RewriteEngine  on
  RewriteRule    ^/(.*)\.html$  /content/siteb/$1.html [PT]

 

Still working on it. will post you back.

Avatar

Level 10

Mahesh Vikram wrote...

we have put this rules in sequence.. but it is going to redirect loop.

 

RewriteRule   ^/geohome.html$    http://mahesh.com/content/mahesh/index.html  [R=301,L]

RewriteRule   ^$    http://mahesh.com/content/mahesh/index.html  [PT,L]

 

we tried this rule, it worked as expected.:-

RewriteEngine  on
  RewriteRule    ^/(.*)\.html$  /content/siteb/$1.html [PT]

 

Still working on it. will post you back.

 

This is confusing, Where how did you come up with siteb and Why do you want user to enter ^/geohome.html$ in first place?

Second If you don't want this then go to your publish /content node and change the rewrite rule /geohome.html to /content/mahesh/index.html or what ever you have in you home page?

Can you share all your rules because i don't think these two rules can go in Redirection loop there has to be something else?

Avatar

Level 10

   If it's your functionality then here is the tested and verified rule 

 RewriteCond %{REQUEST_URI}  ^/geohome.html$
    RewriteCond %{HTTP_HOST}  ^mahesh.com$
    RewriteRule  ^/geohome.html$  /content/mahesh/index.html   [L,R=301]
        
      RewriteCond %{REQUEST_URI} ^(/|)$
      RewriteCond %{HTTP_HOST} ^mahesh.com$ [NC]
       RewriteRule ^/$  /content/mahesh/index.html [L,PT]

Avatar

Level 5

Hi Amit, 

Thank a lot  for your response..

I have put the rules  u have mentioned.. it is not working.

RewriteCond %{REQUEST_URI}  ^/geohome.html$
    RewriteCond %{HTTP_HOST}  ^mahesh.com$
    RewriteRule  ^/geohome.html$  /content/mahesh/index.html   [L,R=301]
        
      RewriteCond %{REQUEST_URI} ^(/|)$
      RewriteCond %{HTTP_HOST} ^mahesh.com$ [NC]
       RewriteRule ^/$  /content/mahesh/index.html [L,PT]

 

Thanks viki