how to tweak these 2 URL

Discuss practical ways rearrange URLs using mod_rewrite.

how to tweak these 2 URL

Postby ehappylucky05 » Sun Mar 29, 2009 7:02 pm

Hi,
How are you?
I have an application that is using 2 type of URL

first type:
http://www.mywebsite.com/component/abc/ ... ly&catid=2

second type:
http://www.mywebsite.com/index.php?opti ... nc=showcat

They are pointing to same location
My question is:
1. How to make a the first type to be

http://www.mywebsite.com/abc.html/post/reply/2

2. How to make a the second type to be

http://www.mywebsite.com/abc.html/showcat/2

Thanks in advance!!
ehappylucky05
 
Posts: 14
Joined: Tue Aug 19, 2008 8:02 am

Postby richardk » Mon Mar 30, 2009 6:20 am

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^([^/]+)\.html/([^/]+)/([^/]+)/([0-9]+)/?$ /component/$1/?func=$2&do=$3&catid=$4 [QSA,L]

RewriteRule ^([^/]+)\.html/([^/]+)/([0-9]+)/?$ /index.php?option=com_$1&func=$2&catid=$3 [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

HI

Postby ehappylucky05 » Mon Mar 30, 2009 1:07 pm

richardk wrote:Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^([^/]+)\.html/([^/]+)/([^/]+)/([0-9]+)/?$ /component/$1/?func=$2&do=$3&catid=$4 [QSA,L]

RewriteRule ^([^/]+)\.html/([^/]+)/([0-9]+)/?$ /index.php?option=com_$1&func=$2&catid=$3 [QSA,L]


Hi Richard,
thanks for your reply. I implemented your script, however, it shows me the 404 not found page.

Hope to hear from you
ehappylucky05
 
Posts: 14
Joined: Tue Aug 19, 2008 8:02 am

Postby richardk » Mon Mar 30, 2009 2:04 pm

What URL are you visiting?
What happens if you replace QSA with R?
Does this mod_rewrite test work?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 31 guests

cron