Comments (14)
Typically URL Rewriting means just that. URL Rewriting. It's used a lot for making urls easier to read for users.
A simple, and probably most common example, would be for removing extensions from URLs. So, an "about" url could look something like this: "http://localhost:8080/about" which the URL Rewriter would change to "http://localhost:8080/about.html" in order for the correct file to be returned to the browser without requiring the input of the file extension in the address bar.
Is this possible to setup with this extension?
from vscode-live-server.
Hi I am using this plugin and it has saved me a lot of troubles. Thanks.
I want to know if there is a way to do a URL rewriting so that my app can always be run through the index.html like .htaccess in apache server
You said you want your app to run through the index.html, so you can do so by specifying the liveserver.settings.file = index.html
And use a package for routing such as react router dom
, if youβre using React.
from vscode-live-server.
So, I'm going to resurrect this thread because it's something I was actually hoping to see and didn't. What the OP is talking about is URL Rewriting. URL Rewriting is when you can type "domain.com/index" instead of "domain.com/index.html". This is usually done in the '.htaccess' file of the website on an Apache2 server and would look something like this:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*?)/?$ /$1.html [L]
RewriteCond works like this
%{REQUEST_FILENAME} is the file address (i.e. /index)
The appended ".html" after that adds the html to turn "/index" into "/index.html"
RewriteRule just defines how to rewrite the the address using regex.
Essentially it says "if the file ./index doesn't exist but ./index.html does exist, get ./index.html instead".
This allows you to use links like "domain.com/index" instead of "domain.com/index.html"
from vscode-live-server.
I think, url rewriting means handling 404 error. (For spa)
Checkout the settings page. There is now new settings called file
... for handling 404 error
from vscode-live-server.
Sorry? What is URL rewriting? Are you talking about SPA?
from vscode-live-server.
@kenshinman I am closing this issue because of since long time didn't got any response from issue reporter.
from vscode-live-server.
It could be file mounting. #72
from vscode-live-server.
Nudge
from vscode-live-server.
AGGRESSIVE NUDGE!
from vscode-live-server.
Sorry for that late, but maybe you're talking about this: liveServer.settings.file
(Path to the entry point file. Useful for SPA)
from vscode-live-server.
That will resolve the issue for SPA's however that won't resolve the scenario I highlighted three years ago.
Typically URL Rewriting means just that. URL Rewriting. It's used a lot for making urls easier to read for users.
A simple, and probably most common example, would be for removing extensions from URLs. So, an "about" url could look something like this: "http://localhost:8080/about" which the URL Rewriter would change to "http://localhost:8080/about.html" in order for the correct file to be returned to the browser without requiring the input of the file extension in the address bar.
Is this possible to setup with this extension?
from vscode-live-server.
So, I'm going to resurrect this thread because it's something I was actually hoping to see and didn't. What the OP is talking about is URL Rewriting. URL Rewriting is when you can type "domain.com/index" instead of "domain.com/index.html". This is usually done in the '.htaccess' file of the website on an Apache2 server and would look something like this:
RewriteEngine on RewriteCond %{REQUEST_FILENAME}.html -f RewriteRule ^(.*?)/?$ /$1.html [L]
RewriteCond works like this %{REQUEST_FILENAME} is the file address (i.e. /index) The appended ".html" after that adds the html to turn "/index" into "/index.html"
RewriteRule just defines how to rewrite the the address using regex.
Essentially it says "if the file ./index doesn't exist but ./index.html does exist, get ./index.html instead". This allows you to use links like "domain.com/index" instead of "domain.com/index.html"
but that doesn't answer the question, does it?
from vscode-live-server.
but that doesn't answer the question, does it?
Obviously not. I'm clarifying what the OP and I were hoping to get an answer on because people were suggesting that OP meant "SPA", file mounting, handling 404, etc. My comment contributes to the topic, yours is just rude, argumentative, and also doesn't answer the question either. I feel like I should be giving you a slow clap for being so impressively arrogant and idiotic.
from vscode-live-server.
Up
from vscode-live-server.
Related Issues (20)
- { "sender": { "name": "Georg Bauer", "address": "Goethestrasse 73, D-45130 Essen, Germany", "IBAN": "DE95360700500073364200", "BIC": "DEUTDEDEXXX" }, "recipient": { "name": "Matteo Brucchioni", "address": "Konstitucijos Ave. 21V, 08130, Vilnius, Lithuania", "IBAN": "LT823250026379885599", "BIC": "REVOLT21" }, "transfer_details": { "amount": "500,000.00", "currency": "EUR", "date": "2024-04-08", "reason": "Payment for consulting services", "reference": "Invoice No. 123456" }, "deadline": "2024-04-08", "transfer_type": "SEPA", "priority": "URGENT", "tracking_code": "SEPA123456789" } HOT 1
- Vs Code Live server doesn't directly open the HTML file
- I getting live server access
- Live server not working on the preview screen HOT 1
- EXTENSION PROBLEM HOT 1
- Live Server cannot be displayed in Chrome
- Live Server cannot be displayed in Chrome HOT 1
- Instant Reload/Auto Reload
- Incorrectly defaults to higher port numbers HOT 1
- code -live server HOT 1
- Ritwick dey live server extension problem
- Image display error in Live Server Visual Studio Code
- Live Server not updating basic anchor tags accordingly.
- THIS IS A CRITICAL BUG! NEEDS IMMEDIATE ATTENTION! HOT 1
- liveserver not working
- Different tabs keep opening for a single content
- open
- how to disable auto refresh in live server
- live server is not working
- live server is not working proper HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-live-server.