detox1978
asked on
http.conf URL rewrite - remove all FQDN links
Hi All,
I work for a company that doesn't have internet access. I'd like to use some open source software, but it because it has loads of internet based content embedded - e.g. google fonts. It takes ages to load.
Would it be possible to change all links to local
e.g.
http://themes.googleusercontent.com/static/fonts/opensans/v6/DXI1ORHCpsQm3Vp6mXoaTXhCUOGz7vYGh680lGh-uXM.woff
To
/static/fonts/opensans/v6/ DXI1ORHCps Qm3Vp6mXoa TXhCUOGz7v YGh680lGh- uXM.woff
Many thanks
D
I work for a company that doesn't have internet access. I'd like to use some open source software, but it because it has loads of internet based content embedded - e.g. google fonts. It takes ages to load.
Would it be possible to change all links to local
e.g.
http://themes.googleusercontent.com/static/fonts/opensans/v6/DXI1ORHCpsQm3Vp6mXoaTXhCUOGz7vYGh680lGh-uXM.woff
To
/static/fonts/opensans/v6/
Many thanks
D
ASKER
There arent that many pages, so only 20ish urls that need switching.
Need help getting it to work.
Need help getting it to work.
ASKER
The question is how to change URL's using http.rewrite, so I don't need to go through each page.
I just need to know the URL's that I'd like to change and http.rewrite will update them before sending the web browser.
I just need to know the URL's that I'd like to change and http.rewrite will update them before sending the web browser.
Replace "YOURDOMAIN.COM" with your actual domain
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^YOURDOMAIN\.com$ [NC]
RewriteRule ^(.*)$ %{SERVER_PROTOCOL}://YOURDOMAIN.com/%{REQUEST_URI} [R=301,L]
ASKER
Sorry for the delay in responding. I've been away with work.
The website URL is http://helpdesk. I added the code below which is being picked up but doesn't change all the URLs to http://helpdesk
Any suggestion?
The website URL is http://helpdesk. I added the code below which is being picked up but doesn't change all the URLs to http://helpdesk
RewriteBase /
RewriteCond %{HTTP_HOST} !^helpdesk$ [NC]
RewriteRule ^(.*)$ %{SERVER_PROTOCOL}://helpdesk/%{REQUEST_URI} [R=301,L]
Any suggestion?
ASKER
e.g. if the source code links to a javascript file https://www.google-analytics.com/ga.js. The user would look receive http://helpdesk/ga.js
ah okay... I was also matching the protocol (http/https)
I've modified it for you below:
RewriteBase /
RewriteCond %{HTTP_HOST} !^helpdesk$ [NC]
RewriteRule ^(.*)$ http://helpdesk/%{REQUEST_URI} [R=301,L]
I've modified it for you below:
RewriteBase /
RewriteCond %{HTTP_HOST} !^helpdesk$ [NC]
RewriteRule ^(.*)$ http://helpdesk/%{REQUEST_URI} [R=301,L]
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
In real life, it's often impractical.