ich und pligg

Wie wir alle wissen (sollten) ändert mod_rewrite keine Links im Script. Damit auch die Links auf Deiner Page auf die neuen "Rewrited URLs" zeigen bedarf es der Anpassung im Code. Fragen und Probleme rund um's Coding werden hier diskutiert.

Moderator: Super-Mod

ich und pligg

Beitragvon n.arc » 17.06.2009 21:56

Hallo, ich bin etwas am verzweifeln :(
Ich habe mir Pligg (www.pligg.com) heruntergeladen und dieses unter dem Ordner /links installiert. Der direkte Aufruf funktioniert auch reibungslos. Nur wenn ich über eine Subdomain darauf zugreifen möchte scheint es nicht zu funktionieren.

Im Root habe ich ein anderes Script mit mod_rewrite am laufen. In der .htaccess im Root habe ich folgendes eingegeben.

Code: Alles auswählen
RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC] [OR]
RewriteCond %{HTTP_HOST} !^links\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]

RewriteBase /
RewriteRule ^(links|usage) - [L]


Sprich das alles auf www.domain.com weiter geleitet wird, nur wenn auf links.domain.com zugegriffen wird, soll eben der script unter dem ordner links gestartet werden. die .htaccess aus dem links ordner sieht wie folgt aus.

Code: Alles auswählen
AddDefaultCharset UTF-8

## 404 Error Page
## If Pligg is installed in a subfolder, change the below line to ErrorDocument 404 /name-of-subfolder/404error.php
ErrorDocument 404 /links/404error.php

## Re-directing Begin
Options +FollowSymlinks -MultiViews
RewriteEngine on

## If Pligg is installed in a subfolder, change the below line to RewriteBase /name-of-subfolder
RewriteBase /links
## If installed in a subfolder you may need to add ## to the beginning of the next line
##RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/

## Remove these two lines if you have a sub-domain like  http://subdomain.pligg.com  or http://localhost
## Keep if your site it like   http://www.pligg.com
##RewriteCond %{HTTP_HOST} !^www\.
##RewriteRule .* http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
##### Re-directing End #####

RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC] [OR]
RewriteCond %{HTTP_HOST} !^hype\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]


## You can find the below lines pre-made for you in the category management section of the admin panel ##
RewriteRule ^(all|hype)/([^/]+)/?$ story.php?title=$2 [L]
RewriteRule ^(all|hype)/?$ ?category=$1 [L]
##

## The settings that you should configure are all above this line.
## Continue below only if you are an advanced user.

##### URL Method 2 Begin #####
RewriteRule ^/?$ index.php [L]
RewriteRule ^advanced-search/?$ advancedsearch.php [L]
RewriteRule ^cache/([0-9]+)/?$ index.php [L]
RewriteRule ^cache/admin_c([0-9]+)/?$ index.php [L]
RewriteRule ^cache/templates_c/([0-9]+)/?$ index.php [L]
RewriteRule ^category/([^/]+)/?$ index.php?category=$1 [L]
RewriteRule ^category/([^/]+)/([^/]+)/?$ story.php?title=$2 [L]
RewriteRule ^live/?$ live.php [L]
RewriteRule ^login/?$ login.php [L]
RewriteRule ^login/([a-zA-Z0-9-]+)/?$ login.php?return=$1 [L]
RewriteRule ^login/([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)/?$ login.php?return=$1/$2 [L]
RewriteRule ^logout/?$ login.php?op=logout&return=index.php [L]
RewriteRule ^logout/([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)/?$ login.php?op=logout&return=$1/$2 [L]
RewriteRule ^out/([\d]+)/?$ out.php?id=$1 [L]
RewriteRule ^out/(https?:.+)$ out.php?url=$1 [L]
RewriteRule ^out/([^/]+)/?$ out.php?title=$1 [L]
RewriteRule ^profile/?$ profile.php [L]
RewriteRule ^recommend/([a-zA-Z0-9-]+)/?$ recommend.php?id=$1 [L]
RewriteRule ^register/?$ register.php [L]
RewriteRule ^search/([^/]+)/page/(\d+)/?$ search.php?search=$1&page=$2 [L]
RewriteRule ^search/(.+)/?$ search.php?search=$1 [L]
RewriteRule ^searchurl/(.+)/?$ search.php?url=$1 [L]
RewriteRule ^settemplate/?$ settemplate.php [L]
RewriteRule ^story/([0-9]+)/?$ story.php?id=$1 [L]
RewriteRule ^story/([^/]+)/?$ story.php?title=$1 [L]
RewriteRule ^story/([0-9]+)/editcomment/([0-9]+)/?$ edit.php?id=$1&commentid=$2 [L]
RewriteRule ^story/([0-9]+)/edit/?$ editlink.php?id=$1 [L]
RewriteRule ^submit/?$ submit.php [L]
RewriteRule ^tag/(.+)/(.+)/?$ search.php?search=$1&tag=true&from=$2 [QSA,NC,L]
RewriteRule ^tag/(.+)/?$ search.php?search=$1&tag=true [QSA,NC,L]
RewriteRule ^tagcloud/?$ cloud.php [L]
RewriteRule ^tagcloud/range/([0-9]+)/?$ cloud.php?range=$1 [L]
RewriteRule ^topusers/?$ topusers.php [L]
RewriteRule ^trackback/([0-9]+)/?$ trackback.php?id=$1  [L]
RewriteRule ^upcoming/?$ upcoming.php [L]
RewriteRule ^upcoming/category/([^/]+)/?$ upcoming.php?category=$1 [L]
RewriteRule ^upcoming/category/([^/]+)/page/(\d+)/?$ upcoming.php?category=$1&page=$2 [L]
RewriteRule ^upcoming/([^/]+)/?$ upcoming.php?part=$1 [L]
RewriteRule ^upcoming/([^/]+)/category/([^/]+)/?$ upcoming.php?part=$1&category=$2 [L]
RewriteRule ^upcoming/page/([0-9]+)/?$ upcoming.php?page=$1 [L]
RewriteRule ^upcoming/([^/]+)/page/(\d+)/?$ upcoming.php?part=$1&page=$2 [L]
RewriteRule ^upcoming/([^/]+)/category/([^/]+)/page/(\d+)/?$ upcoming.php?part=$1&category=$2&page=$3 [L]
RewriteRule ^user/?$ user.php [L]
RewriteRule ^user/search/([^/]+)/?$ user.php?view=search&keyword=$1 [L]
RewriteRule ^user/([a-zA-Z0-9-]+)/?$ user.php?view=$1 [L]
RewriteRule ^user/([a-zA-Z0-9+]+)/([a-zA-Z0-9+]+)/?$ user.php?view=$1&login=$2 [L]
RewriteRule ^user/([a-zA-Z-]+)/link/([0-9+]+)/?$ user_add_remove_links.php?action=$1&link=$2 [L]

## Admin
RewriteRule ^admin/?$ admin/admin_index.php [L]
RewriteRule ^admin_comments/page/([^/]+)/?$ admin/admin_comments.php?page=$1 [L]
RewriteRule ^admin_links/page/([^/]+)/?$ admin/admin_links.php?page=$1 [L]
RewriteRule ^admin_users/page/([^/]+)/?$ admin/admin_users.php?page=$1 [L]
RewriteRule ^story/([0-9]+)/modify/([a-z]+)/?$ admin/linkadmin.php?id=$1&action=$2 [L]
RewriteRule ^view/([^/]+)/?$ admin/admin_users.php?mode=view&user=$1 [L]

## Groups
RewriteRule ^groups/?$ groups.php [L]
RewriteRule ^groups/submit/?$ submit_groups.php [L]
RewriteRule ^groups/([a-zA-Z0-9_-]+)/?$ group_story.php?title=$1 [L]
RewriteRule ^groups/([a-zA-Z0-9_-]+)/page/([0-9]+)?$ group_story.php?title=$1&page=$2 [L]
RewriteRule ^groups/([a-zA-Z0-9_-]+)/?$ group_story.php?title=$1&view=published [L]
RewriteRule ^groups/([a-zA-Z0-9_-]+)/(published|upcoming|shared|members)/?$ group_story.php?title=$1&view=$2 [L]
RewriteRule ^groups/([a-zA-Z0-9_-]+)/(published|upcoming|shared|members)/page/([0-9]+)?$ group_story.php?title=$1&view=$2&page=$3 [L]
RewriteRule ^groups/([a-zA-Z0-9_-]+)/(published|upcoming|shared|members)/category/([^/]+)/?$ group_story.php?title=$1&view=$2&category=$3 [L]
RewriteRule ^groups/([a-zA-Z0-9_-]+)/(published|upcoming|shared|members)/category/([^/]+)/page/([0-9]+)?$ group_story.php?title=$1&view=$2&category=$3&page=$4 [L]
RewriteRule ^groups/delete/([0-9]+)/?$ deletegroup.php?id=$1 [L]
RewriteRule ^groups/edit/([0-9]+)/?$ editgroup.php?id=$1 [L]
RewriteRule ^groups/id/([0-9]+)/?$ group_story.php?id=$1 [L]
RewriteRule ^groups/join/([0-9]+)/? join_group.php?id=$1&join=true [L]
RewriteRule ^groups/member/admin/id/([0-9]+)/role/([a-zA-Z0-9_-]+)/userid/([0-9]+)/?$ groupadmin.php?id=$1&role=admin&userid=$3 [L]
RewriteRule ^groups/member/normal/id/([0-9]+)/role/([a-zA-Z0-9_-]+)/userid/([0-9]+)/?$ groupadmin.php?id=$1&role=normal&userid=$3 [L]
RewriteRule ^groups/member/moderator/([0-9]+)/role/([a-zA-Z0-9_-]+)/userid/([0-9]+)/?$ groupadmin.php?id=$1&role=$2&userid=$3 [L]
RewriteRule ^groups/member/flagged/([0-9]+)/role/([a-zA-Z0-9_-]+)/userid/([0-9]+)/?$ groupadmin.php?id=$1&role=flagged&userid=$3 [L]
RewriteRule ^groups/member/banned/id/([0-9]+)/role/([a-zA-Z0-9_-]+)/userid/([0-9]+)/?$ groupadmin.php?id=$1&role=banned&userid=$3 [L]
RewriteRule ^groups/page/([0-9]+)/?$ groups.php?page=$1 [L]
RewriteRule ^groups/unjoin/([0-9]+)/([a-zA-Z0-9-]+)/?$ join_group.php?id=$1&privacy=$2&join=false [L]
RewriteRule ^groups/withdraw/([0-9]+)/user_id/([0-9]+)/?$ join_group.php?group_id=$1&user_id=$2&activate=withdraw [L]
RewriteRule ^join_group/action/(published|queued|discard)/link/(\d+)/?$ join_group.php?action=$1&link=$2 [L]

## Live
RewriteRule ^comments/?$ live_comments.php [L]
RewriteRule ^comments/page/([^/]+)/?$ live_comments.php?page=$1 [L]
RewriteRule ^live_published/?$ live_published.php [L]
RewriteRule ^published/page/([^/]+)/?$ live_published.php?page=$1 [L]
RewriteRule ^unpublished/?$ live_unpublished.php [L]
RewriteRule ^unpublished/page/([^/]+)/?$ live_unpublished.php?page=$1 [L]

## Modules
RewriteRule ^inbox/?$ module.php?module=simple_messaging&view=inbox [L]
RewriteRule ^sitemapindex.xml module.php?module=xml_sitemaps_show_sitemap [L]
RewriteRule ^sitemap-([a-zA-Z0-9]+).xml module.php?module=xml_sitemaps_show_sitemap&i=$1 [L]

## Pages
RewriteRule ^about/?$ page.php?page=about [L]
RewriteRule ^static/([^/]+)/?$ page.php?page=$1 [L]

## Pagination
RewriteRule ^category/([^/]+)/page/([^/]+)/?$ index.php?category=$1&page=$2 [L]
RewriteRule ^page/([^/]+)/?$ index.php?page=$1 [L]
RewriteRule ^page/([^/]+)/([^/]+)category/([^/]+)/?$ index.php?page=$1&part=$2&category=$3 [L]
RewriteRule ^published/page/([^/]+)/?$ index.php?page=$1 [L]
RewriteRule ^published/page/([^/]+)/category/([^/]+)/?$ index.php?page=$1&category=$2 [L]
RewriteRule ^published/page/([^/]+)/([^/]+)category/([^/]+)/?$ index.php?page=$1&part=$2&category=$3 [L]
RewriteRule ^published/page/([^/]+)/([^/]+)/?$ index.php?page=$1&part=$2 [L]
RewriteRule ^published/page/([^/]+)/range/([^/]+)/?$ ?page=$1&range=$2 [L]
RewriteRule ^search/page/([^/]+)/([^/]+)/?$ search.php?page=$1&search=$2 [QSA,NC,L]
RewriteRule ^topusers/page/([^/]+)/?$ topusers.php?page=$1 [L]
RewriteRule ^topusers/page/([^/]+)/sortby/([^/]+)?$ topusers.php?page=$1&sortby=$2 [L]
RewriteRule ^user/page/([^/]+)/([^/]+)/([^/]+)/?$ user.php?page=$1&view=$2&login=$3 [L]
RewriteRule ^user/([^/]+)/([^/]+)/page/(\d+)/?$ user.php?page=$3&view=$1&login=$2 [L]

## Sort
RewriteRule ^(year|month|week|today|yesterday|recent)/?$ index.php?part=$1 [L]
RewriteRule ^(year|month|week|today|yesterday|recent)/category/([^/]+)/?$ index.php?part=$1&category=$2 [L]
RewriteRule ^(year|month|week|today|yesterday|recent)/page/(\d+)/?$ index.php?part=$1&page=$2 [L]
RewriteRule ^(year|month|week|today|yesterday|recent)/category/([^/]+)/page/(\d+)/?$ index.php?part=$1&category=$2&page=$3 [L]

## RSS
RewriteRule ^([^/]+)/rss/?$ storyrss.php?title=$1 [L]
RewriteRule ^rss/?$ rss.php [L]
RewriteRule ^rss/([a-zA-Z0-9-]+)/?$ rss.php?status=$1 [L]
RewriteRule ^rss/category/([^/]+)/?$ rss.php?category=$1 [L]
RewriteRule ^rss/category/upcoming/([^/]+)/?$ rss.php?status=queued&category=$1 [L]
RewriteRule ^rss/category/published/([^/]+)/?$ rss.php?status=published&category=$1 [L]
RewriteRule ^rss/category/([^/]+)/queued/?$ rss.php?status=queued&category=$1 [L]
RewriteRule ^rss/category/([^/]+)/published/?$ rss.php?status=published&category=$1 [L]
RewriteRule ^rss/category/([^/]+)/group/([a-zA-Z0-9_-]+)/?$ rss.php?category=$1&group=$2 [L]
RewriteRule ^rss/category/upcoming/([^/]+)/([a-zA-Z0-9_-]+)/?$ rss.php?status=queued&category=$1&group=$2 [L]
RewriteRule ^rss/category/published/([^/]+)/([a-zA-Z0-9_-]+)/?$ rss.php?status=published&category=$1&group=$2 [L]
RewriteRule ^rss/search/([a-zA-Z0-9-]+)/?$ rss.php?search=$1 [L]
RewriteRule ^rss/user/([a-zA-Z0-9-]+)/?$ userrss.php?user=$1 [L]
RewriteRule ^rss/user/([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)/?$ userrss.php?user=$1&status=$2 [L]
RewriteRule ^rssfeeds/?$ rssfeeds.php [L]

RewriteRule ^upcoming/([^/]+)/?$ upcoming.php?category=$1 [L]
RewriteRule ^upcoming/([^/]+)/page/(\d+)/?$ upcoming.php?category=$1&page=$2 [L]
RewriteRule ^upcoming/(year|month|week|today|yesterday|recent)/([^/]+)/?$ upcoming.php?part=$1&category=$2 [L]
RewriteRule ^upcoming/(year|month|week|today|yesterday|recent)/([^/]+)/page/(\d+)/?$ upcoming.php?part=$1&category=$2&page=$3 [L]
RewriteRule ^published/page/([^/]+)/([^/]+)/?$ index.php?page=$1&category=$2 [L]
RewriteRule ^published/page/([^/]+)/([^/]+)/([^/]+)/?$ index.php?page=$1&part=$2&category=$3 [L]
RewriteRule ^(year|month|week|today|yesterday|recent)/([^/]+)/?$ index.php?part=$1&category=$2 [L]
RewriteRule ^(year|month|week|today|yesterday|recent)/([^/]+)/page/(\d+)/?$ index.php?part=$1&category=$2&page=$3 [L]

## 9.9.5 compatibility
RewriteRule ^user/view/([a-zA-Z0-9-]+)/?$ user.php?view=$1 [L]
RewriteRule ^user/view/([a-zA-Z0-9+]+)/([a-zA-Z0-9+]+)/?$ user.php?view=$1&login=$2 [L]
RewriteRule ^user/view/([a-zA-Z0-9+]+)/login/([a-zA-Z0-9+]+)/?$ user.php?view=$1&login=$2 [L]
RewriteRule ^published/([a-zA-Z0-9-]+)/?$ index.php?part=$1
RewriteRule ^published/([a-zA-Z0-9-]+)/category/([a-zA-Z0-9_-]+)/?$ index.php?part=$1&category=$2
RewriteRule ^about/([a-zA-Z0-9-]+)/?$ page.php?page=about [L]
RewriteRule ^upcoming/page/([^/]+)/category/([^/]+)/?$ upcoming.php?page=$1&category=$2 [L]
RewriteRule ^upcoming/page/([^/]+)/upcoming=([^/]+)category/([^/]+)/?$ upcoming.php?page=$1&part=upcoming&order=$2&category=$3 [L]
RewriteRule ^statistics/page/([^/]+)/?$ module.php?module=pagestatistics&page=$1


RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/?$ index.php?category=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/page/([^/]+)/?$ index.php?category=$1&page=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/([^/]+)/?$ story.php?title=$2 [L]
##### URL Method 2 End #####

## Disable directory browsing
Options All -Indexes

## Gzip Begin ##
## To enable Gzip and decrease the load times of your Pligg site
## change /home/path/to to your absolute server path and remove the # from the lines below
# php_value auto_prepend_file /home/path/to/begin_gzip.php
# php_value auto_append_file /home/path/to/end_gzip.php
# AddType "text/javascript" .gz
# AddEncoding gzip .gz
# RewriteCond %{HTTP:Accept-encoding} gzip
# RewriteCond %{THE_REQUEST} ^(.*).js
# RewriteCond %{SCRIPT_FILENAME}.gz -f
# RewriteRule ^(.*)\.js $1.js.gz [L]
## Gzip End ##

## Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
## Block out any script trying to base64_encode stuff to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
## Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
## Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
## Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})

## Block pycurl bot
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^pycurl/ [NC]
RewriteRule .* - [F]


Vielleicht habe ich etwas übersehen, oder habe einen Fehler drin. Jedenfalls immer wenn ich links.domain.com eingebe werde ich immer auf den Root weitergeleitet, und eben der Script abgerufen im Root verzeichniss.

Würde mich freuen wenn mir jemand kurz helfen könnte.
n.arc
.
.
 
Beiträge: 16
Registriert: 14.10.2005 20:11

Zurück zu Programmierung & Scriptanpassung für mod_rewrite

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 0 Gäste