Foren / Cotonti / Support / mod_rewrite HELP needed

url rewriting in .htaccess to create SEO subdomains and subfolders

donP
#23618 17. März 2010, 21:39
I already answered this question but nobody could help me... But i think this would be a great enancement for a Cotonti-driven website, giving webmasters the ability to create more structure, using fake subdomains and subfolders, also for SEO...

Now, I need to work with Rewriting Rules in .htaccess to create fake subdomains for the main categories of my page-structure, like this:

FOR LISTS:
http://www.sangelo.net/list.php?c=cat    ==>    http://cat.sangelo.net
http://www.sangelo.net/list.php?c=subcat    ==>    http://cat.sangelo.net/subcat/
http://www.sangelo.net/list.php?c=subsubcat    ==>    http://cat.sangelo.net/subcat/subsubcat/

FOR PAGES:
http://www.sangelo.net/page.php?al=ALIAS    ==>    http://cat.sangelo.net/alias.html
http://www.sangelo.net/ (of a subcat) page.php?al=ALIAS    ==>    http://cat.sangelo.net/subcat/alias.html
http://www.sangelo.net/ (of a subsubcat) page.php?al=ALIAS    ==>    http://cat.sangelo.net/subcat/subsubcat/alias.html

Actually, I'm only albe to do the first rewriting
http://www.sangelo.net/list.php?c=cat    ==>    http://cat.sangelo.net
using this code:
RewriteCond %{HTTP_HOST} !www.sangelo.net$ [NC]
RewriteCond %{HTTP_HOST} ^([A-Za-z0-9\-]+).sangelo.net$ [NC]
RewriteRule (.*) list.php?c=%1 [NE,NC,L,QSA]

But when I try to do the second level (adding a subcat like a fake subfolder), with this rule:
RewriteCond %{HTTP_HOST} ^([A-Za-z0-9\-]+).sangelo.net/([A-Za-z0-9\-]+) [NC]
RewriteRule (.*) list.php?c=%2 [NE,NC,L,QSA]
nothing happens... it still present me the subdomain path (cat.sangelo.net) and its real content (list.php?c=cat)

Why?

Anyone can help me?
in [color=#729FCF][b]BLUES[/b][/color] I trust

Dieser Beitrag wurde von donP (am 17. März 2010, 22:26, vor 15 Jahre) bearbeitet