Mobile app version of vmapp.org
Login or Join
Ann8826881

: Help with URL and HTACCESS I have a social engine 3 website, in my website all URLS can be changed(URL-REWRITING) through the SE-url settings automatically, but in my website their is one module

@Ann8826881

Posted in: #Htaccess #UrlRewriting

I have a social engine 3 website, in my website all URLS can be changed(URL-REWRITING) through the SE-url settings automatically, but in my website their is one module which is custom coded, where I have to set its URL manually in htaccess file,

the url which I want to changes is this:

mysite.com/institutes_desc.php?id=19


I want this URL to be changed like

mysite.com/institutes/intitute_name or mysite.com/institutes/intitute_id

My htaccess file is this

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

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

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

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

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

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

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

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

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

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

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


Can anyone help me in this? how can I set my url this way?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Ann8826881

1 Comments

Sorted by latest first Latest Oldest Best

 

@Martha676

I'll assume that institute IDs have to be integers - no letters or decimal points or anything.

# Turn on URL re-writing
RewriteEngine On

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


For further information, I refer you to Dave Childs' thorough introduction to URL rewriting.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme