problem with ?

New to mod_rewrite? This is a good place to start.

problem with ?

Postby iamzamp » Sat May 16, 2009 9:03 am

Migrating my web site and changing the Search Engine Friendly component, I've many problems with the old url already indexed by google etc.

my url indexed is now

http://website.com/index.php?/content/v ... _CATEGORY/

my new Sef build the url like this:

http://website.com/component/content/ar ... ID_ARTICLE

the problem is the ? after the index.php, the \escape character doesn't function... i can't find a right rewrite url!
iamzamp
 
Posts: 5
Joined: Sat May 16, 2009 3:35 am

Postby richardk » Sat May 16, 2009 9:15 am

Query strings are matched with the %{QUERY_STRING} variable and RewriteConds.

Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{QUERY_STRING} ^/content/view/([0-9]+)/([0-9]+)/$ [NC]
RewriteRule ^index\.php$ /component/content/article/%2/%1 [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby iamzamp » Sat May 16, 2009 9:52 am

I want to try in an another directory first.

what about i want to try in a temp directory, where I installed the new system? for example a dir called

www.website.com/giveatry
iamzamp
 
Posts: 5
Joined: Sat May 16, 2009 3:35 am

Postby richardk » Sun May 17, 2009 9:05 am

What URL will you be visiting? What URL do you want to be redirected to?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby iamzamp » Mon May 18, 2009 3:25 am

i want to click on

http://website.com/giveatry/index.php?/ ... _CATEGORY/

and go to


http://website.com/giveatry/component/c ... ID_ARTICLE


and this has to be passed by the new sef. is it possible?

btw, thank you very much, you're helping me understand
iamzamp
 
Posts: 5
Joined: Sat May 16, 2009 3:35 am

Postby richardk » Mon May 18, 2009 11:21 am

Replace
Code: Select all
/component/content/article/%2/%1

with
Code: Select all
/giveatry/component/content/article/%2/%1

and put the mod_rewrite in /giveatry/.htaccess.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby iamzamp » Tue May 19, 2009 8:45 am

in this way, I get

Redirect Loop
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

The browser has stopped trying to retrieve the requested item. The site is redirecting the request in a way that will never complete.

* Have you disabled or blocked cookies required by this site?
* NOTE: If accepting the site's cookies does not resolve the problem, it is likely a server configuration issue and not your computer.

I think is because the link has to be parsed again by the sef. so, maybe i should put the option as if I were using the component without the sef:

/giveatry/index.php?option=com_content&view=article&id=$ARTICLEID&catid=$CATID

I try this way and let you know.
iamzamp
 
Posts: 5
Joined: Sat May 16, 2009 3:35 am

Postby iamzamp » Tue May 19, 2009 9:04 am

yes, the last method functioned!

so, everybody can use this way to make url redirection for joomla, after a migration from 1.0 to 1.5

thank you very much.
iamzamp
 
Posts: 5
Joined: Sat May 16, 2009 3:35 am


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 6 guests

cron