We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

htaccess help please | Forum

Marcus
Marcus Nov 25 '15
I am using this htaccess

#Search
RewriteEngine on
RewriteRule   ^custompage/(.*?)\.html$ custompage/custom?test=$1 [L,QSA]

And my init.php

OW::getRouter()->addRoute(new OW_Route('custompage.index', '/custompage', "CUSTOMPAGE_CTRL_Custom", 'index'));

But when I try this URL it says not found:

http://localhost/site/custompage/custom/seo.html

What it's not rewriting the URL????
ross Team
ross Nov 25 '15
Marcus
Marcus Nov 28 '15
Thanks guys so much. It doesn't seem to work.

I have created a custom PHP page just like described here: http://www.oxwall.org/forum/topic/19839

Now I would like to use that page as directory like this: buscar-pareja so the URL will look like this: example.com/buscar-pareja

Now I use this URL to pass the value to SQL: example.com/buscar-pareja?id=sevilla  and it works.

The problem is that I wanna rewrite the URL to make it look seo friendly like this:

example.com/buscar-pareja?id=sevilla

to

example.com/buscar-pareja/sevilla
 
And it just not happening I mean say page not found looks like it doesn't even get processed but the htaccess!

This is the code i use:

#Search
RewriteEngine on
RewriteRule   ^buscar-pareja/(.*?)$ buscar-pareja/custom?id=$1 [L,QSA]
The Forum post is edited by Marcus Nov 28 '15
ross Team
ross Nov 30 '15
Topic was moved from Bug reports and troubleshooting.
Mike
Mike Nov 30 '15
Hey,

you can pass Arguments seo friendly within the init.php
OW::getRouter()->addRoute(new OW_Route('custompage.index', '/custompage/:param1/:id', "CUSTOMPAGE_CTRL_Custom", 'index'));

now the custom.php should look like this:
class CUSTOMPAGE_CTRL_Custom extends OW_ActionController
{
 public function index($params)
 {
  echo $params['param1'];
  echo $params['id'];
 }
}
The Forum post is edited by Mike Nov 30 '15
Marcus
Marcus Nov 30 '15
OMG Mike you are my hero baby you just nailed it I mean thanks so much OMG!
Mike
Mike Nov 30 '15
:D no problem