Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued/Classic Products: Instant Website: Realty/Listings/Auto:
Permalinks

 

 


richc
User

Sep 8, 2009, 10:26 PM

Post #1 of 13 (5294 views)
Shortcut
Permalinks Can't Post

While I'm here I may as well go for broke :0)

Can I get rid of the /listingDetail.php? links and have more friendly links..? Wordpress blogs do something similar that involves a mod rewrite in the .htaccess file

Thanks


Donna
Staff / Moderator


Sep 9, 2009, 11:48 AM

Post #2 of 13 (5264 views)
Shortcut
Re: [richc] Permalinks [In reply to] Can't Post

Hi Rich!

Take a look at this page in the CMS Builder documentation for details on how to do that:

http://www.interactivetools.com/docs/cmsbuilder/file_extensions.html

I hope this helps. :)

Donna

--
support@interactivetools.com


richc
User

Sep 9, 2009, 3:16 PM

Post #3 of 13 (5250 views)
Shortcut
Re: [Donna] Permalinks [In reply to] Can't Post

Hi Donna

I tried the last example on that page but I still have php extensions..

I'd like to get rid of the ? as well to have great seo urls

Thanks

Rich


Donna
Staff / Moderator


Sep 14, 2009, 1:10 PM

Post #4 of 13 (5124 views)
Shortcut
Re: [richc] Permalinks [In reply to] Can't Post

Hi Rich,

This is basically more mod_rewrite stuff -- google "mod_rewrite" and you can find a wide variety of things you can change. Try searching through the forums for some examples that we've come up with as well... here are a couple that I found:

http://www.interactivetools.com/forum/gforum.cgi?post=73857#73857

http://www.interactivetools.com/forum/gforum.cgi?post=59720#59720

Donna

--
support@interactivetools.com


richc
User

Sep 14, 2009, 5:39 PM

Post #5 of 13 (5107 views)
Shortcut
Re: [Donna] Permalinks [In reply to] Can't Post

Still not getting anywhere. To be more specific what i would like is for

/category.php/record/ to display as /category/record.html

and

/category.php to display as /category.html

Or, if we can't achieve that


/category.php/record/ to display as /category/record/

and

/category.php to display as /category/

would be OK


Donna
Staff / Moderator


Sep 15, 2009, 5:13 PM

Post #6 of 13 (5047 views)
Shortcut
Re: [richc] Permalinks [In reply to] Can't Post

Hi Rich,

As I mentioned on the phone, mod_rewrites aren't really something that we support, although you could contact our consulting to write them for you. mod_rewrites can be pretty tricky and tend to take a lot of research to track down, so they can take quite a lot of time to write.

Or, if you'd like to try your hand at setting up your own mod_rewrite, take a look at the Apache documentation here:

http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html

(Sorry if I sounded a bit short on the phone, I'm about 2 weeks into a wretched case of bronchitis, and I'm told that my voice is a bit surly at the moment! Definitely not intended.) :)

Donna

--
support@interactivetools.com


richc
User

Sep 15, 2009, 5:32 PM

Post #7 of 13 (5044 views)
Shortcut
Re: [Donna] Permalinks [In reply to] Can't Post

Hi Donna

No problem..!

The issue is the code you have in your support documents - it doesn't work so you should fix it or remove it. On this page http://www.interactivetools.com/docs/cmsbuilder/file_extensions.html you suggest using this code:


Code
RewriteEngine On 
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+)$ $1.php [L,QSA]


It works beautifully for say domain.com/listings.php or anything in root, but if you have seo links switched on it won't work for say domain.com/listings.php/listingDetails/

Very frustrating as I'm sure it's a trivial change


richc
User

Sep 15, 2009, 6:56 PM

Post #8 of 13 (5040 views)
Shortcut
Re: [richc] Permalinks [In reply to] Can't Post

I have fixed this now, probably not the best way to do it though, just set a rule for each "folder"


Dave
Staff / Moderator


Sep 15, 2009, 9:14 PM

Post #9 of 13 (5024 views)
Shortcut
Re: [richc] Permalinks [In reply to] Can't Post

Hi Rich,

Another solution might be to remove the "RewriteBase /" line. You'd have to test it and see if it worked for your configuration, though.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com
 


richc
User

Sep 15, 2009, 9:29 PM

Post #10 of 13 (5019 views)
Shortcut
Re: [Dave] Permalinks [In reply to] Can't Post

Hi Dave,

What are you doing working at this time??

I have managed to get the htaccess working fine but now my links have broken down from my categoriesLinks page to my categoryLinksDetail page. works fine when I use the php extension but not when I don't.

The problem seems to be getNumberFromEndOfUrl returns 0 instead of the actual number when i use /category/detail/ as opposed to category.php/detail


Dave
Staff / Moderator


Sep 16, 2009, 10:51 AM

Post #11 of 13 (4922 views)
Shortcut
Re: [richc] Permalinks [In reply to] Can't Post

Hi Rich,

Yea, mod_rewrite is really powerful but it can get really tricky really quickly.

I found the simplest is to use the regular non-seo urls in CMS Builder and then mod_rewrite to map to that.

I start by figuring out what I want the urls to look like, eg:
http://host/category/detail/123

And where they should be rewritten to point to. eg:
http://host/categoryDetail.php?num=123

And then figure out the rule (untested), eg:
RewriteRule ^category/detail/(.*) /categoryDetail.php?num=$1 [nc]

You can capture parts of the url with the (brackets) and put them in the replacement url with $1.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com
 


richc
User

Sep 16, 2009, 2:09 PM

Post #12 of 13 (4910 views)
Shortcut
Re: [Dave] Permalinks [In reply to] Can't Post

This mod rewrite tool is handy too:


http://civilolydnad.se/projects/rewriterule/


Dave
Staff / Moderator


Sep 16, 2009, 3:01 PM

Post #13 of 13 (4904 views)
Shortcut
Re: [richc] Permalinks [In reply to] Can't Post

Yea, that is neat. I was thinking someone should make something like that. Thanks for sharing the link! :)

Dave Edis - Senior Developer
interactivetools.com