LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-23-2018, 12:00 PM   #1
boredazfcuk
LQ Newbie
 
Registered: Oct 2014
Posts: 7

Rep: Reputation: Disabled
nginx/apache locally served facebook profile #DeleteFacebook


Hi,

We've decided to #DeleteFacebook and downloaded all the household's data in 4 separate zip files.

I've then moved the files to both nginx and apache and get the same problem on both.

The files supplied by FB use relative paths in them. If I click 'photos' or 'messages' down the left hand side, it will display fine, but then if I change sections to 'videos' or whatever, it breaks.

eg. I load up the profile main page hxxp://server/profile1/index.htm and it loads correctly. I click 'Videos' from the side menu on the left and it correctly serves hxxp://server/profile1/html/videos.htm. I then click 'Messages' from the side menu and it attempts to serve hxxp://server/profile1/html/html/messages.htm which fails. It's happening because the side bar is requesting html/message.htm and that is relative to the hxxp://server/profile1/html folder that the previous file was served from.

How do I tell nginx or apache that all requested relative paths should be relative to hxxp://server/profile1 and not whatever sub-directory has been served already? Or can I not do that and I need to re-write the URL instead?

IE & Chrome handle it fine when it's served from a local folder on my laptop. It's that behaviour I would like to emulate if possible.

Sorry if these are noob questions, web servers aren't really my thing.

Thanks,

bored.
 
Old 03-23-2018, 06:05 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
It's happening because the side bar is requesting html/message.htm and that is relative to the hxxp://server/profile1/html folder that the previous file was served from.

How do I tell nginx or apache that all requested relative paths should be relative to hxxp://server/profile1 and not whatever sub-directory has been served already? Or can I not do that and I need to re-write the URL instead?
If I understand well what you're trying to accomplish, you can rewrite the URL to suppress one "/html".
For apache it can be done with mod_rewrite by adding the following in the apache config file:
Code:
RewriteEngine on

RewriteRule /html/html/(.*) /html/$1
This rewrite rule can easily be adapted for nginx

Regards
 
1 members found this post helpful.
Old 03-24-2018, 02:53 PM   #3
boredazfcuk
LQ Newbie
 
Registered: Oct 2014
Posts: 7

Original Poster
Rep: Reputation: Disabled
That worked perfectly. Thank you.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Two physical apache hosts served by one machine sagaciouskjb Linux - Server 1 10-19-2009 09:06 AM
blank pages served from apache mjenkins Linux - Server 0 11-15-2006 04:24 PM
Apache? Php? non-existent pages getting served... bulliver Linux - General 2 08-14-2006 07:48 PM
how to set descriptions for files served by Apache servnov Linux - Newbie 2 11-12-2004 07:35 AM
png images not served by apache ..??? gene_gEnie Linux - Software 2 05-10-2002 08:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration