简体   繁体   中英

How to add rewrite in bitnami site

I have created new bitnami site and added some rewrite rules for some pages. All pages work fine except one link which is camera details link.

Cameras list page link work fine as I expected

http://{site-domain}/public/cameras

But detail link does not work

http://{site-domain}/public/cameras/ruthin-school

I am using following rule for detail page:

<rule name="Show public camera details" stopProcessing="true">
  <match url="^/?public/cameras/([^/]+)$" ignoreCase="true" />
  <conditions logicalGrouping="MatchAll">
    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
  </conditions>
  <action type="Rewrite" url="/public/cameras/index.php?{R:1}" />
</rule>

Any thoughts?

Bitnami developer here.

Maybe that's not working because Apache is the one who is making the redirection to other pages, so I highly recommend you to move that configuration to the /opt/bitnami/apps/wordpress/conf/htaccess.conf file.

Here is the guide about writing the rules for apache, is pretty similar to the rules you are using now: http://httpd.apache.org/docs/current/mod/mod_rewrite.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM