Jump to content

htaccess issue


jacmaes
 Share

Recommended Posts

Hi there, 

I'm trying to add a section to my site in the root folder (www.mysite.com/calendar/), independent of Processwire. The problem I have is when I try to add a rewrite rule in my .htaccess to have SEO-friendly URLs.

Basically, I want www.mysite.com/calendar/30/ instead of www.mysite.com/calendar/event.php?id=30. Problem is, Processwire's rewrite rules seems to take over, and www.mysite.com/calendar/30/ redirects to the homepage.

This is my .htaccess in the "calendar" folder:

RewriteEngine on
DirectoryIndex index.php
RewriteBase /calendar/
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*)/$ event.php?id=$1 [L]

What am I missing?

Link to comment
Share on other sites

I've managed to "fix" it by putting the following rule in the main .htaccess file at the root level:

RewriteRule ^calendar/(.*)/$ calendar/event.php?id=$1 [L]

This correctly rewrites to www.mysite.com/calendar/30 (or whatever id number), and does not seem to interfere with Processwire directives. I'm posting this in case it helps someone in the same situation.

  • Like 1
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...