possible to create short url? (www.domain.com/forums) ?

Started by DAB Empire, August 25, 2005, 12:12:29 PM

Previous topic - Next topic

DAB Empire

Is there any way to use rewrite or anything to create a short url for the bridged forums?  Not a redirect, but it would actually create url's as SMF does regularly.

Example:
Forum source - www.domain.com/forum
Bridged forums - www.domain.com/component.......
Short URL to bridged forums - www.domain.com/forums

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

[Unknown]

Couldn't you use mod_rewrite, Kindred?  For example:

RewriteMatch /forum/(index.php)? /component/option,com_smf/ItemId,47/
RewriteMatch /forum/index.php/(.*)$ /component/option,com_smf/ItemId,47/$1
RewriteMatch /forum/index.php\?(.*)$ /component/option,com_smf/ItemId,47/?$1

-[Unknown]

Orstio

There should be a way to do it with mod_rewrite.

Playing with .htaccess isn't one of my specialties...

Kindred

[Unknown]...

after thinking about it, I agree, you may be correct...   using mod_rewrite in the htaccess file, like you suggest SHOULD have the effect he is looking for.

The user could then type in site.com/forum and be redirected to site.com/index.php/coponent... etc
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

DAB Empire

Well, it did redirect everything correctly.   But, I was hoping for it to display the short url.  It redirects to the component url.  I am hoping to have a short url so it's easy for people to use and those that already skip the bridge and type in directly to the forum url can continue to do so as well.

Kindred

well....  it's still easy for them to use. They type in the URL and are redirected. They don't have to know the redirect, they can still type in the "short" url...

but access to the bridge, if it is not standalone MUST be accessed by com_smf.
As noted by [unknown], you can use mod_rewrite to redirect the short urls over to the correct one (which is what you are doing) but the correct one needs to display in the address bar, otherwise all the _GETs etc will be screwed up.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

buf

EliteRides, keep an eye out for this: http://opensef.org/
Meanwhile, you may try xaneon extensions 2.0.0 beta 2, it seems to be working for me (at least, right now).
CMS-PT.com - Comunidade de Webmasters e Admins

DAB Empire


[Unknown]

Quote from: Kindred on September 02, 2005, 10:10:04 AM
well....  it's still easy for them to use. They type in the URL and are redirected. They don't have to know the redirect, they can still type in the "short" url...

but access to the bridge, if it is not standalone MUST be accessed by com_smf.
As noted by [unknown], you can use mod_rewrite to redirect the short urls over to the correct one (which is what you are doing) but the correct one needs to display in the address bar, otherwise all the _GETs etc will be screwed up.

Actually, that can be changed too.

If you use an internal redirect (which, iirc, is the default) you can modify smf.php to point to that URL, and it will be no different to Apache.

-[Unknown]

DAB Empire

I have a weird issue.  When I originally tried this it worked fine.  Now when I add it to my forums .htaccess file I get an internal server error.  Here is what I added.

RewriteMatch /forums/(index.php)? /component/option,com_smf/ItemId,175/
RewriteMatch /forums/index.php/(.*)$ /component/option,com_smf/ItemId,175/$1
RewriteMatch /forums/index.php\?(.*)$ /component/option,com_smf/ItemId,175/?$1

DAB Empire


[Unknown]

I don't see what would cause a 500 from that.  You'llhave to check your error log.

By the way, change this:

RewriteMatch /forums/(index.php)? /component/option,com_smf/ItemId,175/

To:

RewriteMatch /forums/(index.php)?$ /component/option,com_smf/ItemId,175/

-[Unknown]

DAB Empire

Here is what the log file says:

Quote[Tue Sep 13 15:49:03 2005] [alert] [client 205.158.36.170]Invalid command 'RewriteMatch', perhaps mis-spelled or defined by a module not included in the server configuration

Did I misspell something, or did my host change their configurations to no longer allow this?

[Unknown]

Do you have RewriteEngine on in the file somewhere?

If so, mod_rewrite is no longer installed.

-[Unknown]

DAB Empire

This is what I have in my forums/.htaccess file:

AddType text/html .shtml .html
AddHandler server-parsed .shtml .html
Options Indexes FollowSymLinks Includes

RewriteEngine

RewriteMatch /forums/(index.php)?$ /component/option,com_smf/ItemId,175/
RewriteMatch /forums/index.php/(.*)$ /component/option,com_smf/ItemId,175/$1
RewriteMatch /forums/index.php\?(.*)$ /component/option,com_smf/ItemId,175/?$1


I don't know what the other stuff is.  I must have copied it form somewhere.  When it worked the first time I must have deleted something I needed for this RewriteMatch to work.  Should I need to delete/add anything?

[Unknown]

Actually, isn't it RewriteRule?  This topic is the second result on Google for "RewriteMatch".

My typo, but why did it work for you at first?

-[Unknown]

DAB Empire

#17
I tried RewriteRule.  I no longer receive a 500 error, but it is not redirecting either.

This goes in the forums/.htaccess file, right?  Not the root .htaccess file?  When it worked for me the first time it was in the forums file.  I run into the same 500 error problems in either .htaccess file I try this in now.

[Unknown]

No, it has to be in the root.  And actually, I think it should be:

RewriteRule ^forums...

For all the rules.  What I posted originally really was just psuedo code.

-[Unknown]

DAB Empire

To make sure I'm on the same page, I have:

RewriteRule ^forums/(index.php)?$ /component/option,com_smf/ItemId,175/
RewriteRule ^forums/index.php/(.*)$ /component/option,com_smf/ItemId,175/$1
RewriteRule ^forums/index.php\?(.*)$ /component/option,com_smf/ItemId,175/?$1


We might be getting closer.  With that I no longer receive an error, but it takes me to my root index page.  I can keep going to eliterides.com/forums but it always takes me to eliterides.com

Advertisement: