Jump to content

ProcessWire in subdirectory


MECU
 Share

Recommended Posts

I have PW installed in subdirectory /pages. This makes all my pages load with URLs like /pages/{slug} which is what I want as I'm only using PW as the CMS for static pages and articles. However I would like the /pages/ url to be redirected to / of the site.

I've tried this in the .htaccess file:

    # Redirect /pages to /
    RewriteRule ^pages/$ / [L,R=301]

right after this:

  # ----------------------------------------------------------------------------------------------- 
  # Ensure that the URL follows the name-format specification required by ProcessWire
  # ----------------------------------------------------------------------------------------------- 

  RewriteCond %{REQUEST_URI} "^/~?[-_.a-zA-Z0-9/]*$"

I did mod the .htaccess in the /pages directory. I also tried the .htaccess in the public directory.

I also tried:

    RewriteRule ^pages$ / [L,R=301]
    RewriteRule ^(pages/)$ / [L,R=301]
    RewriteRule ^(pages)/$ / [L,R=301]
    RewriteRule ^(pages)$ / [L,R=301]

Any suggestions?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...