So I finally found this website after searching for mod_rewrite coding, asking around, etc.
I have used mod_rewrite to create friendly URL's for just one of my websites. It's a nice, clean way to organize thousands of "pages", when they're actually fields in my database.
In addition to the dynamic friendly URL's I created, there are a few template, css, etc files in a few static folders throughout my site.
I accidentally created a mess when I switched to go daddy (godaddy.com) on the lowest hosting account, which allows 1 hosted domain plus email accounts and all that jazz ... but allows you to alias other domains to the one hosted account. Sounds fine and dandy if you have a search portal with pop-up downloaders and a whole bunch of the same stuff ... but I have 8 domains, 8 seperate websites. I found the code after searching for weeks, thanks to Richardk on this forum.
-------------
Currently, I have a few php files routing the main portions of my website (example: /contact, /products, /services). Using just one php file for all 8 of my domains, could someone help me write a mod_rewrite script that will accomplish the following, dynamically:
* Point domains I have put into an array somewhere (preferably in the htaccess file itself) to their proper folder
*look for static folders
* If no static folder found, look for dynamic via my mod_rewrite code
Hosted domain = hosted.com
Alias domain 2 = alias2.com
Alias domain 3 = alias3.com
Alias domain 4 = alias4.com
Alias domain 5 = alias5.com
Alias domain 6 = alias6.com
Alias domain 7 = alias7.com
Alias domain 8 = alias8.com
Feel free to edit my previous code, it's working, but it's also patch-work code...
--------------------------------------------------
ErrorDocument 404 %{HTTP_HOST}/?
Options +FollowSymLinks
RewriteEngine On
# Previous working mod_rewrite for alias8.com
RewriteRule ^gallery/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([.A-Za-z0-9-]+)/?$ /templates/gallery/router.php?passed_venue_name=$1&passed_venue_section=$2&passed_venue_other=$3 [N]
RewriteRule ^gallery/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ /templates/gallery/router.php?passed_venue_name=$1&passed_venue_section=$2 [N]
RewriteRule ^gallery/([A-Za-z0-9-]+)/?$ /templates/gallery/router.php?passed_venue_name=$1 [N]
RewriteRule ^gallery/?$ /templates/gallery/router.php? [L]
--------------------------------------------
# Code, compliments of richardk via modrewrite.com's forums
# Points alias8.com to a folder on my hosted.com domain
# Add missing trailing slashes.
RewriteCond %{HTTP_HOST} ^(www\.)?alias8\.com$ [NC]
RewriteCond %{DOCUMENT_ROOT}/alias8%{REQUEST_URI}/ -d
RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]
# Domain to sub directory.
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} ^(www\.)?alias8\.com$ [NC]
RewriteRule ^(.*)$ /alias8/$1 [QSA,L]
--------------------------------------------
So to summarize what I'm trying to do here ...
1)
I would like each of the alias domains to point to a sub folder on the hosted domain.
2)
I would love a simple solution suggestion ... as far as adding another domain quickly, and preferably static.
3)
I would like mod_rewrite to try and find a physical folder on the server. If it doesn't exist, then look to a template php script file for direction. Currently, I have a maximum of 5 folders from the root of the domain ... not including the hosted.com/alias8/ folder
4)
In addition to creating friendly folders dynamically, the files should work too ... but they would only be images, movies, a few php files with template includes and such, etc. I can add to a list of file formats if it's necessary to add mime types in this code.
----------------------------
Thanks for your time ... it seems like a lot to ask, especially all at once.
Sean Francis[/list]