jacmaes Posted September 25, 2013 Posted September 25, 2013 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?
jacmaes Posted September 26, 2013 Author Posted September 26, 2013 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. 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now