Pretty URLs problem .

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
voxberry
Forum Members
Forum Members
Posts: 56
Joined: Tue Sep 01, 2009 1:04 pm

Pretty URLs problem .

Post by voxberry »

Hello pplz .

I'm trying to build a new website with cmsms 1.6.6 .. and I am trying to build a new function to read some custom databases and output some info .

I installed pretty URLS (.htaccess and config modrewrite) .

So now, http://www.site.com/index.php?page=home becomes http://www.site.com/home
   
The problem : at some point I have to pass some vars over the url, like :
    http://www.site.com/index.php?page=home ... r=somedata[/b]
and I wanna use some rewrite rules in .htaccess so the url will look like this :
    http://www.site.com/home/[b]SOMEDATA[/b]

And I can not figure it out . I have tryed a lot of combinations of rules and rewrite actions none work .

In my .htaccess file there is the defaul line :
        RewriteRule ^(.+)$ index.php?page=$1 [QSA]

what does NOT work for me :
        RewriteRule ^(.+)/(.+)/$ index.php?page=$1&myvar=$2 [NC,L]

Any help would be very useful ! THANKS .
voxberry
Forum Members
Forum Members
Posts: 56
Joined: Tue Sep 01, 2009 1:04 pm

Re: Pretty URLs problem .

Post by voxberry »

the only thing that works is a combined link and that kinda sucks :

http://www.site.com/home/[b]?myvar=somedata[/b]

how do I make this go way ???
voxberry
Forum Members
Forum Members
Posts: 56
Joined: Tue Sep 01, 2009 1:04 pm

Re: Pretty URLs problem .

Post by voxberry »

in the dark ... looking for the light ... still no way out .
i have tryed out many combinations of conditions and rulez, nothing works ....

I found a fix for the news rss with the htaccess . i tryed to do it like that, still, nothing ... it doesn;t work ...
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Pretty URLs problem .

Post by Dr.CSS »

You may have to explain in more detail what and why your doing what your doing...
voxberry
Forum Members
Forum Members
Posts: 56
Joined: Tue Sep 01, 2009 1:04 pm

Re: Pretty URLs problem .

Post by voxberry »

ok .
I will do just that .

I have a funtion that needs to $_GET a var over the URL, besides page var, so I know what to pull out of the database .
I have a custom database, besides the cms default stuff, and I will make links like :

http://www.site.com/index.php?page=home ... r=somedata[/b]

where MYVAR will be what I need from the database to be printed .

So besides the default htaccess line where : RewriteRule ^(.+)$ index.php?page=$1 [QSA] .
this and the config line with $config['use_hierarchy'] = true; you will get nice urls .

But I need a new rule as I have a custom new addition to the link : &myvar=somedata

Anyway ... I said this allready .
after many hours of learning about how to write htaccess rules and conditions, I ended up with this :

RewriteRule ^members/(.+)/$ members.html?myvar=$1   #--- myline
RewriteRule ^(.+)\.html$ index.php?page=$1 [QSA]  # --- default line from pretty urls

This almost works ... but not 100 % .
this still looks very twistted.
Post Reply

Return to “CMSMS Core”