HELP - Convert Rewrite Rules

Topics: Developer Forum, Project Management Forum, User Forum
Jan 8, 2011 at 3:57 PM

I have this URL rewrite folder ... but linux hosting. Can someone help me to fix this?

#RewriteLog <DOCUMENT_ROOT>\isapirewrite\IsapiRewrite_log.out
#RewriteLogLevel 1

#MaxMatchCount 10

# WITHOUT SUBFOLDER (BEGIN)

# Sitemap
#RewriteRule ^.*/sitemap\.xml$ /custom/sitemap/index.xml
#RewriteRule ^.*/sitemapnews\.xml$ /custom/sitemap/indexnews.xml

# RSS
#RewriteRule ^.*/([a-z]+)/rss/([a-z]+)_([a-zA-Z0-9-_]+)\.xml$ /$1/$2/rss/index.php?qs=$4

# Listings
#RewriteRule ^.*/listing/([a-zA-Z0-9-_]+)\.(html|htm)$ /listing/detail.php?listing=$1
#RewriteRule ^.*/listing/([a-zA-Z0-9-_]+)\.(html|htm)#([a-zA-Z0-9-_]+)$ /listing/detail.php?listing=$1#$2
#RewriteRule ^.*/listing/type/([a-zA-Z0-9-_]+)$ /listing/results.php?template=$1
#RewriteRule ^.*/listing/guide/([a-zA-Z0-9-_]+)/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?$ /listing/results.php?category1=$1&category2=$2&category3=$3&category4=$4&category5=$5
#RewriteRule ^.*/listing/location/([a-zA-Z0-9-_]+)/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?$ /$1/listing/results.php?friendLoc1=$2&friendLoc2=$3&friendLoc3=$4&friendLoc4=$5&friendLoc5=$6
#RewriteRule ^.*/listing/reviews/([a-zA-Z0-9-_]+)$ /listing/comments.php?listing=$1
#RewriteRule ^.*/listing/claim/([a-zA-Z0-9_-_]+)$ /claim.php?claim=$1

# Promotion
#RewriteRule ^.*/coupon/guide/([a-zA-Z0-9-_]+)/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?$ /coupon/results.php?category1=$1&category2=$2&category3=$3&category4=$4&category5=$5
#RewriteRule ^.*/coupon/location/([a-zA-Z0-9-_]+)/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?$ /$1/coupon/results.php?friendLoc1=$2&friendLoc2=$3&friendLoc3=$4&friendLoc4=$5&friendLoc5=$6

# Event
#RewriteRule ^.*/event/([a-zA-Z0-9-_]+)\.(html|htm)$ /event/detail.php?event=$1
#RewriteRule ^.*/event/guide/([a-zA-Z0-9-_]+)/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?$ /event/results.php?category1=$1&category2=$2&category3=$3&category4=$4&category5=$5
#RewriteRule ^.*/event/location/([a-zA-Z0-9-_]+)/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?$ /$1/event/results.php?friendLoc1=$2&friendLoc2=$3&friendLoc3=$4&friendLoc4=$5&friendLoc5=$6

# Classified
#RewriteRule ^.*/classified/([a-zA-Z0-9-_]+)\.(html|htm)$ /classified/detail.php?classified=$1
#RewriteRule ^.*/classified/guide/([a-zA-Z0-9-_]+)/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?$ /classified/results.php?category1=$1&category2=$2&category3=$3&category4=$4&category5=$5
#RewriteRule ^.*/classified/location/([a-zA-Z0-9-_]+)/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?$ /$1/classified/results.php?friendLoc1=$2&friendLoc2=$3&friendLoc3=$4&friendLoc4=$5&friendLoc5=$6

# Articles
#RewriteRule ^.*/article/([a-zA-Z0-9-_]+)\.(html|htm)$ /article/detail.php?article=$1
#RewriteRule ^.*/article/guide/([a-zA-Z0-9-_]+)/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?$ /article/results.php?category1=$1&category2=$2&category3=$3&category4=$4&category5=$5
#RewriteRule ^.*/article/reviews/([a-zA-Z0-9-_]+)$ /article/comments.php?article=$1

# Blog
#RewriteRule ^.*/([a-zA-Z0-9_-_]+)/blog/([a-zA-Z0-9-_]+)\.(html|htm)$ /$1/blog/detail.php?blog=$2
#RewriteRule ^.*/([a-zA-Z0-9_-_]+)/blog/guide/([a-zA-Z0-9-_]+)/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?$ /$1/blog/results.php?category1=$2&category2=$3&category3=$4&category4=$5&category5=$6
#RewriteRule ^.*/([a-zA-Z0-9_-_]+)/blog/reviews/([a-zA-Z0-9-_]+)$ /$1/blog/comments.php?blog=$2
#RewriteRule ^.*/([a-zA-Z0-9_-_]+)/blog/page/([a-zA-Z0-9-_]+)$ /$1/blog/index.php?pn=$2

# Profile
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^.*/([a-zA-Z0-9_-_]+)/profile/(.*)?$ /$1/profile/index.php?url_full=%{URL} [L]

# Content
#RewriteRule ^.*/content/([a-zA-Z0-9-]+)\.(html|htm)$ /content/index.php?content=$1

# WITHOUT SUBFOLDER (END)

# WITH SUBFOLDER (BEGIN)

# Sitemap
#RewriteRule ^.*/([a-zA-Z0-9_-]+)/sitemap\.xml$ /$1/custom/sitemap/index.xml
#RewriteRule ^.*/([a-zA-Z0-9_-]+)/sitemapnews\.xml$ /$1/custom/sitemap/indexnews.xml

# RSS
#RewriteRule ^.*/([a-zA-Z0-9_-]+)/([a-z]+)/rss/([a-z]+)_([a-zA-Z0-9-_]+)\.xml$ /$1/$2/rss/index.php?qs=$4

# Listings
#RewriteRule ^.*/([a-zA-Z0-9_-]+)/listing/([a-zA-Z0-9-_]+)\.(html|htm)$ /$1/listing/detail.php?listing=$2
#RewriteRule ^.*/([a-zA-Z0-9_-]+)/listing/([a-zA-Z0-9-_]+)\.(html|htm)#([a-zA-Z0-9-_]+)$ /$1/listing/detail.php?listing=$2#$3
#RewriteRule ^.*/([a-zA-Z0-9_-]+)/listing/type/([a-zA-Z0-9-_]+)$ /$1/listing/results.php?template=$2
#RewriteRule ^.*/([a-zA-Z0-9_-]+)/listing/guide/([a-zA-Z0-9-_]+)/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?$ /$1/listing/results.php?category1=$2&category2=$3&category3=$4&category4=$5&category5=$6
#RewriteRule ^.*/([a-zA-Z0-9_-]+)/listing/location/([a-zA-Z0-9-_]+)/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?$ /$1/listing/results.php?friendLoc1=$2&friendLoc2=$3&friendLoc3=$4&friendLoc4=$5&friendLoc5=$6
#RewriteRule ^.*/([a-zA-Z0-9_-]+)/listing/reviews/([a-zA-Z0-9-_]+)$ /$1/listing/comments.php?listing=$2
#RewriteRule ^.*/([a-zA-Z0-9_-]+)/listing/claim/([a-zA-Z0-9-_]+)$ /$1/claim.php?claim=$2

# Promotion
#RewriteRule ^.*/([a-zA-Z0-9_-]+)/coupon/guide/([a-zA-Z0-9-_]+)/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?$ /$1/coupon/results.php?category1=$2&category2=$3&category3=$4&category4=$5&category5=$6
#RewriteRule ^.*/([a-zA-Z0-9_-]+)/coupon/location/([a-zA-Z0-9-_]+)/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?$ /$1/coupon/results.php?friendLoc1=$2&friendLoc2=$3&friendLoc3=$4&friendLoc4=$5&friendLoc5=$6

# Event
#RewriteRule ^.*/([a-zA-Z0-9_-]+)/event/([a-zA-Z0-9-_]+)\.(html|htm)$ /$1/event/detail.php?event=$2
#RewriteRule ^.*/([a-zA-Z0-9_-]+)/event/guide/([a-zA-Z0-9-_]+)/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?$ /$1/event/results.php?category1=$2&category2=$3&category3=$4&category4=$5&category5=$6
#RewriteRule ^.*/([a-zA-Z0-9_-]+)/event/location/([a-zA-Z0-9-_]+)/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?$ /$1/event/results.php?friendLoc1=$2&friendLoc2=$3&friendLoc3=$4&friendLoc4=$5&friendLoc5=$6

# Classified
#RewriteRule ^.*/([a-zA-Z0-9_-_]+)/classified/([a-zA-Z0-9-_]+)\.(html|htm)$ /$1/classified/detail.php?classified=$2
#RewriteRule ^.*/([a-zA-Z0-9_-_]+)/classified/guide/([a-zA-Z0-9-_]+)/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?$ /$1/classified/results.php?category1=$2&category2=$3&category3=$4&category4=$5&category5=$6
#RewriteRule ^.*/([a-zA-Z0-9_-_]+)/classified/location/([a-zA-Z0-9-_]+)/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?$ /$1/classified/results.php?friendLoc1=$2&friendLoc2=$3&friendLoc3=$4&friendLoc4=$5&friendLoc5=$6

# Articles
#RewriteRule ^.*/([a-zA-Z0-9_-_]+)/article/([a-zA-Z0-9-_]+)\.(html|htm)$ /$1/article/detail.php?article=$2
#RewriteRule ^.*/([a-zA-Z0-9_-_]+)/article/guide/([a-zA-Z0-9-_]+)/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?$ /$1/article/results.php?category1=$2&category2=$3&category3=$4&category4=$5&category5=$6
#RewriteRule ^.*/([a-zA-Z0-9_-_]+)/article/reviews/([a-zA-Z0-9-_]+)$ /$1/article/comments.php?article=$2

# Blog
#RewriteRule ^.*/([a-zA-Z0-9_-_]+)/blog/([a-zA-Z0-9-_]+)\.(html|htm)$ /$1/blog/detail.php?blog=$2
#RewriteRule ^.*/([a-zA-Z0-9_-_]+)/blog/guide/([a-zA-Z0-9-_]+)/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?/?([a-zA-Z0-9-_]+)?$ /$1/blog/results.php?category1=$2&category2=$3&category3=$4&category4=$5&category5=$6
#RewriteRule ^.*/([a-zA-Z0-9_-_]+)/blog/reviews/([a-zA-Z0-9-_]+)$ /$1/blog/comments.php?blog=$2
#RewriteRule ^.*/([a-zA-Z0-9_-_]+)/blog/page/([a-zA-Z0-9-_]+)$ /$1/blog/index.php?pn=$2

# Content
#RewriteRule ^.*/([a-zA-Z0-9_-]+)/content/([a-zA-Z0-9-]+)\.(html|htm)$ /$1/content/index.php?content=$2

# WITH SUBFOLDER (END)

Thank you so much.

Coordinator
Jan 9, 2011 at 1:42 PM

fix what?

what problem are you trying to solve?

Jan 9, 2011 at 10:09 PM

This code was in asapirewrite folder. It is designed to work for Windows. I wold like for someone to help me to convert these rules to work using simple .htaccess folder that I want to place in root directory.

I guess line would start:

Options +FollowSymLinks

RewriteEngine On

RewriteBase /

And then code needs to be corrected to work in Linux. I am only guessing and can make it work partially by adding [L] to the end of every line and by removing .*/ from the begining and then removing \ but again I have no knowledge and I am just guessing.

Coordinator
Jan 10, 2011 at 8:37 PM

I think you're on the wrong forum.  This is for users of IIRF, which runs on IIS and Windows.

Good luck.