Forum Moderators: phranque
I have a webshop and a forum, the webshop is one of these off the shelf hosted else where sites, easyier for me and my business, dont need to worry about too much during our first year. Forum is hosted on a server i set up with another host. At the moment domain name points to index file on my server which iframes users to my shop showing my domain name at the top, its only when a user goes into the forum's it can drill down.
Is there any way to rewrite so i can pritty much hide the fact the webshop is hosted else where, at the moment using iframes the URl is static, and the status bar gives away the orginal url, (which it self is a security issue)
so i can go to...
www.mysite.co.uk/catergories/dogs/ (which would in thoery be www.otherhost.co.uk/catergories/dogs
but when on forum the URL would be correct
forum is fine its just the shop
thanks in advance
if ANYONE happends to come across this post looking for the same solusion as me,
Options +FollowSymlinks
RewriteEngine On
RewriteEngine On
RewriteRule (.*) [websiteyouaremirroring.co.uk...] [P]
make sure you delete your index.html as i forgot...
RewriteRule (.*) http://websiteyouaremirroring.co.u[b]k/$[/b]1 [P]
Be aware, however, that all logs and 'stats' on the 'shop' server will show *all* requests as coming from the front-end server, and not from the original client. If this matters, then you will need to change the configuration on the front-end to send along the X-Forwarded-For header, and you will need to modify the 'shop' server to log that header instead of the Remote-Addr information in order to properly show the actual "user's" address. If you can't do that, then the best solution is to host the shop on your own server instead of using this 'partial' reverse-proxy set-up.
Jim
I don't understand that statement at all, but if the single-slash version doesn't work entirely correctly (as it indeed should), then there is something very wrong somewhere else in the server or system configuration.
Jim
RewriteCond $1 !^robots\.txt$
RewriteRule ^(.*)$ http://mirror-example.com/$1 [P]
Jim
You might consider the reverse-logic approach: Don't proxy a request to the back-end if the requested object exists on your own server. That may require quite a bit of care and thought and list-making to be sure you've covered all of the if-and-or-buts in every case...
You may also find it useful to sort your files into different (sub)directories to simplify the logic and the rules needed to implement this correctly.
Jim
Options +FollowSymlinks
RewriteEngine On
RewriteEngine On
RewriteBase /
RewriteRule ^(robots\.txt) - [L]
RewriteRule (.*) [mirrorurl.co.uk...] [P]
just some things i copyed and pasted from google.
Thanks for the 2x above code, the site map ect ive managed to also exclude as the one provided by the webshop host doesnt match my url vus google declines it.
thanks for your help so far, the amount i've picked up with regards to css javascript, php and this in the last few weeks is crazy... to think i quit my job for all this..
RewriteEngine on
RewriteBase /
#
RewriteCond $1 !^robots\.txt$
RewriteRule ^(.*)$ http://mirror-example.com/$1 [P]
A quick survey of the Web shows that most code posted on-line is inefficient, broken, dangerous, or all of these... And that applies here at WebmasterWorld as well, unless someone has already replied to the thread and posted corrections. (That's because the source of the original code is often 'just some Web site' and the posted code was copied and pasted here without any analysis -- It's a vicious circle.)
Even then, there is no guarantee that code which is 100% technically-correct and efficiently-coded will work correctly (or at all) on your site -- In the abstract, it may do something quite correctly, but there's no guarantee that what it does is what you actually need to do on your site.
Bad or inappropriate code can take your server down instantly -- *if* you are lucky. If you're not lucky, one tiny little typo or subtle logic error may quietly destroy your user experience and/or search engine rankings over time.
Anyway, please don't use code that you've found 'out on the street' until you understand it completely and it has earned your trust...
Note that you don't need that RewriteBase directive to set the base back to "/" unless you've got another RewriteBase directive earlier in this file that has previously set the base to some other location. Unless you've changed it previously in this file, "/" is the default.
Jim