Forum Moderators: phranque

Message Too Old, No Replies

I need a landing page for many root relative sites

mod rewrite, landing, multiple sites

         

mvoermans

7:13 pm on Mar 18, 2009 (gmt 0)

10+ Year Member



I am trying to create a landing page that will direct users of the site to a subfolder. Inside each subfolder will be a demo site or a full build of a site. These subfolder sites currently are linked to the root of the site. I have tried many times to get mod rewrite to redirect them where to be, but I was largely unsuccessful without breaking others, at most I could only redirect it for one site.

Below is a very crude site layout. If more information is needed please let me know.

Landing Page
- Subsite1
- assets / etc

- Subsite2
- assets/ etc

g1smd

8:48 pm on Mar 18, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Instead of a redirect, you'll likely need a rewrite.

That will use very similar syntax, but it has a completely different effect.

Do you understand the critical differences between an external redirect and an internal rewrite?

mvoermans

9:00 pm on Mar 18, 2009 (gmt 0)

10+ Year Member



Ideally I would like to use mod rewrite to change the destination of the links/ images / etc.

I was trying stuff like this:

Options +FollowSymLinks
Options +Indexes
RewriteEngine On
RewriteBase /

#RewriteCond %{HTTP_REFERER} ^http://sub.mydomain.com/subsite1/
#RewriteCond %{REQUEST_URI} ^/assets
#RewriteRule ^(.*)$ /subsite1%{REQUEST_URI}?filePath=$1 [R=301]
#RewriteRule ^(.*)$ /subsite1/$1?filePath=$1 [R=301]

but unless I put this in the root level assets folder I didn't have much luck - which made me realize that it was not hitting the htaccess the page lived in - but the one that the file being requested lived in.