.htaccess - Redirect wordpress urls to joomla urls on the same domain -


this first question on stack overflow. site bible me , hope question not redundant.

well. i'm creating news site joomla 3. site replcae , old site made wordpress. i'd set redirect rules on same domain.

on wordpress news this: /ita/news or /eng/news/ on joomla conf: /ita/category/id-news.html /eng/category/id-news.html news have same title , same url both on joomla , wp there ia way on htaccess match title of news of wp links , compare last part of links of joomla site , set rewrite condition?

if not possible possibilities creare redirect 301 news? this?

redirect 301 /ita/news /ita/category/id-news.html

thanks gabriele

use redirectmatch specify pattern.

redirectmatch 301 /([^/]+)/([^/]+) /$1/category/id-$2.html 

using mod_rewrite instead, able restrict redirection happen when url path (i.e. directory structure /eng/news/) physically not exist.

rewriteengine on rewritebase /  rewritecond %{request_filename} !-d # not dir rewritecond %{request_filename} !-f # not file rewriterule ^([^/]+)/([^/]+)$ $1/category/id-$2.html [r=301,l] 

this assumes .htaccess resides in web root folder.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -