it-swarm.com.de

Hilfe bei URL und HTACCESS

Ich habe eine Social Engine 3-Website. Auf meiner Website können alle URLs automatisch über die SE-URL-Einstellungen geändert (URL-REWRITING) werden. Auf meiner Website handelt es sich jedoch um ein Modul, das benutzerdefiniert codiert ist und dessen URL ich manuell festlegen muss in der htaccess-Datei,

die URL, die ich ändern möchte, lautet:

mysite.com/institutes_desc.php?id=19

Ich möchte, dass diese URL wie folgt geändert wird

mysite.com/institutes/intitute_name oder mysite.com/institutes/intitute_id

Meine htaccess-Datei ist dies

RewriteEngine On
Options +Followsymlinks
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.* - [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*/images/(.*)$ /images/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*/uploads_user/(.*)$ /uploads_user/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/?$ /profile.php?user=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/([^/]+)?$ /profile.php?user=$1$2 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/documentgroups/([0-9]+)/([0-9]+)/([^/]+)/?$ /documentgroup.php?user=$1&documentgroup_id=$2&group_id=$3&title=$4 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/documentgroups/([0-9]+)/([^/]+)?$ /documentgroup.php?user=$1&documentgroup_id=$2$3 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/documents/([0-9]+)/([^/]+)/?$ /document.php?user=$1&document_id=$2&title=$3 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/documents/([0-9]+)/([^/]+)?$ /document.php?user=$1&document_id=$2$3 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/documents/?$ /documents.php?user=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/documents/?$ /documents.php?user=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^documents/tag/([^/]+)/?$ /browse_documents.php?tag=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^documents/category/([0-9]+)/?$ /browse_documents.php?i=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/blog/([0-9]+)/?$ /blog.php?user=$1&blogentry_id=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/blog/([^/]+)?$ /blog.php?user=$1$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/blog/?$ /blog.php?user=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/trackback/([0-9]+)/?$ /blog_ajax.php?task=trackback&user=$1&blogentry_id=$2 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/videos/([0-9]+)/?$ /video.php?user=$1&video_id=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*/)?group/([0-9]+)/([^/]*)$ /group.php?group_id=$1$2$3 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*/)?group/([0-9]+)/album/([0-9]+)/([^/]*)$ /group_album_file.php?group_id=$2&groupmedia_id=$3$4 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*/)?group/([0-9]+)/discussion/([0-9]+)/([^/]*)$ /group_discussion_view.php?group_id=$2&grouptopic_id=$3$4 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*/)?group/([0-9]+)/discussion/([0-9]+)/([0-9]+)/([^/]*)$ /group_discussion_view.php?group_id=$2&grouptopic_id=$3&grouppost_id=$4$5 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/articles/([^/]+)?$ /articles.php?user=$1$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/articles/?$ /articles.php?user=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^article/([0-9]+)(/[^/]*)?$ /article.php?article_id=$1&article_slug=$2 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/job/([0-9]+)/?$ /job.php?user=$1&jobentry_id=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/job/([^/]+)?$ /job.php?user=$1$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/job/?$ /job.php?user=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/trackback/([0-9]+)/?$ /job_ajax.php?task=trackback&user=$1&jobentry_id=$2 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/classifieds/([0-9]+)/?$ /classified.php?user=$1&classified_id=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/classifieds/([0-9]+)/([^/]+)?$ /classified.php?user=$1&classified_id=$2$3 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/classifieds/?$ /classifieds.php?user=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*/)?event/([0-9]+)/([^/]*)$ /event.php?event_id=$1$2$3 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*/)?event/([0-9]+)/album/([0-9]+)/([^/]*)$ /event_album_file.php?event_id=$2&eventmedia_id=$3$4 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^application/([0-9]+)/?$ /app.php?id=$1 [L]

Kann mir jemand dabei helfen? Wie kann ich meine URL so einstellen?

1
Niraj Chauhan

Ich gehe davon aus, dass Instituts-IDs Ganzzahlen sein müssen - keine Buchstaben oder Dezimalstellen oder so.

# Turn on URL re-writing
RewriteEngine On

# Clean URLs for institutes.
RewriteRule ^institutes/([0-9]+)/?$   /institutes_desc.php?id=$1    [NC,L]

Für weitere Informationen verweise ich Sie auf Dave Childs ' gründliche Einführung in das Umschreiben von URLs .

2
Will Martin