dreamweaver regular expression - dreamweaver

I have the canonical line in a huge pages as below
<link rel="canonical" href="10-effective-ways-to-reduce-merchant-cash-advance-business-costs.php" />
sure every page has it's own url, I want to search this line for all the pages and change .php to be .html
I hope if you can help

I found the solution find
<link rel="canonical"([^<]*).php
replace with
<link rel="canonical"$1.html

Related

How does app.use(express.static("public")) work with nested URL's?

I am quite new to node and I am trying to wrap my head around how the express.static middleware is working. In my views folder I have some href's like this:
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
My application is able to grab these files form URLS's such as localhost/about, localhost/contact etc. However it will not grab files if the end point is something like localhost/form/new. Is express.static getting these static assets from localhost/somefile and when there is a nested URL it defaults to /form/somefile (which won't work)? I am aware that if you put a '/' before vendor it will work from any level, why is this? Thank you.
app.use(express.static(“public”));
That is a way of saying "hey express, look if any incoming requests (like GET /bundle.css matches a file on that directory, if so, send it!".
Any file on that directory, you should be able to access under /. If you're serving from your localhost and have bundle.css on public folder, you can visit http://localhost/bundle.css.
Any asset you're trying to get from public folder, should start with / meaning look for an absolute path (in this case, the path public folder is serving which is /).
Update
There is another way of doing that using relative path which is not recommendable.
If you're in /about/index.html and you're trying to get /css/bundle.css (under public's folder)
Absolute Path:
<link rel="stylesheet" href="/css/bundle.css">
Relative Path: (not recommendable)
<link rel="stylesheet" href="../css/bundle.css">
The only thing to keep in mind is to make a slash mark before the static file address.
<link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="/css/style.css" type="text/css">
If you do not put this slash before the address, you will have a problem loading styles, images, etc. in the nested addresses.
For example, if you use the following addressing instead of the above operation, you will definitely have problems in the nested URL.
<link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="css/style.css" type="text/css">
This is especially useful on page 404.

.htaccess works like i created a new directory

I have bone.php and bone.css inside public_html in my server. Inside bone.php i have a link tag which calls bone.css <link rel="stylesheet" type="text/css" href="bone.css">. i have created .htaccess file for bone.php file
RewriteRule ^community/([0-9a-zA-Z]+) bone.php?first=$1 [NC, L]
After i created .htaccess i need to change link tag like <link rel="stylesheet" type="text/css" href="../bone.css">. Which means bone.php thinks its inside a folder, which is not.
If its only way i need change all links inside my website. I hope someone will say there is an another way.Thanks
This is because your relative URIs have their base changed. Originally, the base is / when the page is /bone.php, and the browser properly fills in relative links with the / base. But when the browser goes to a page like /community/foo/ the base suddenly becomes /community/foo/ and it tries to append that in front of all relative URLs and thus none of them load.
You can either make your links absolute, or change the URI base in the header of your pages (inbetween the <head> </head> tags):
<base href="/">

htacess seo friendly not working proplery

I am trying to make seo friendly url for my page http://www.jobslamp.com/jobsbystate.php?s=af3d1405&st=Kerala . I have tried some htacess code before , but then the designs are lost. Could u plz suggest the proper htacess code to achieve this . I would like to get an url like http://www.jobslamp.com/jobsbystate.php/af3d1405&st/Kerala
Thanks in advance
This sounds like you're linking to CSS or javascript using relative URI's instead of absolute URI's. You can either make all of your links absolute by adding a leading slash (for example):
<link rel="stylesheet" href="main.css" type="text/css">
to:
<link rel="stylesheet" href="/main.css" type="text/css">
Or you can define the URI base in the header of your pages by adding:
<base href="/">
or whatever the base should be.

Enable HTML code only in Dreamweaver's Designer

I need some HTML code to be processed only by Dreamweaver's Designer.
To be more exact, I need smth. like this:
<html>
...
<link rel="stylesheet" type="text/css" media="screen" href="styles_print.css" title="printer_friendly_css" />
<!-- FOR_DREAMWEAVER_DESIGNER_ONLY
<link rel="stylesheet" type="text/css" media="screen" href="styles.css" title="normal_css" />
-->
...
</html>
So that when this page is being viewed in Dreamweaver's Designer, the effective HTML looks like this (second tag is "uncommented"):
<html>
...
<link rel="stylesheet" type="text/css" media="screen" href="styles_print.css" title="printer_friendly_css" />
<link rel="stylesheet" type="text/css" media="screen" href="styles.css" title="normal_css" />
...
</html>
and when the same page is being viewed somewhere else (e.g. in regular browser), it is processed as it should be (second tag is ignored because it is commented).
Is this possible? Does Dreamweaver have this kind of feature?
Dreamweaver has a feature called Design Time Style sheets to handle this type of functionality. It allows you to apply styles only within Dreamweaver not on the live page. You can even hide styles at design time that would be present live.
Format -> CSS Styles -> Design-time
Adobe help for Design time style sheets:
http://help.adobe.com/en_US/dreamweaver/cs/using/WScbb6b82af5544594822510a94ae8d65-7e17a.html
You can even use design time style sheets to help you track down potential problems with your CSS. Here's an article I wrote a while a go about that topic:
http://www.webassist.com/free-downloads/tutorials-and-training/roadmaps/roadmap_07.php
If you're using PHP and you want to apply site-wide and you have an include that is in every page take a look at:
http://james.revillini.com/2008/01/24/solved-dreamweaver-site-wide-design-time-style-sheets-using-templates/
Dreamweaver extension that can apply them site wide (Commercial, but only $5, haven't tried in in several versions of Dreamweaver, but I think it should still work):
http://www.communitymx.com/abstract.cfm?cid=61265

Application Relative Paths IIS

I'm moving an web application to a subdirectory from it's root and having issues with paths.
Old: http://www.domain.com/
New: http://www.domain.com/app/
All of the include css, scripts and html links where in this format:
<link rel="stylesheet" type="text/css" href="/styles/menu.css" media="screen"/>
I've changed to:
<link rel="stylesheet" type="text/css" href="./styles/menu.css" media="screen"/>
or
<link rel="stylesheet" type="text/css" href="~/styles/menu.css" media="screen"/>
It works fine on links and others until I go one directory deep where links and paths are broken.
e.g.
www.domain.com/app/dir1/
www.domain.com/app/dir2/
There the link url or others (scripts, includes, etc) get duplicate paths.
e.g.
www.domain.com/app/dir1/dir1/
www.domain.com/app/dir2/dir2/
How could I approach this as absolute?
Using ~/style... etc is the easiest solution in ASP.NET but you must put runat="server" in the tag for it to actually work

Resources