I'm having weird issues with the HTML in the information page. Any HTML I type has \" added to the left and right so the following iframe would turn to this:
Before:
<iframe src="http://www.google.com/"></iframe>
After:
<p><iframe src="\"http://www.google.com/\""></iframe></p>
OpenCart Version: 1.5.5.1
create file at root with dots: .user.ini
put this:
magic_quotes_gpc = Off
and then save
You are typing your code directly into the WYSIWYG side of the editor. This will escape all the html entities like you are seeing.
All you need to do is hit the "Source" button, and put your HTML into this view instead.
I managed to fix this issue by forcing the magic_quotes off in .htaccess:
<IfModule mod_suphp.c>
suPHP_ConfigPath /home/user/public_html
</IfModule>
Related
I am trying to change the permalink structure of my Wordpress site and setting up proper redirects. Here is what I am trying to achieve:
Old permalink structure:
/category/post-name
New permalink structure:
/postname
Redirecting would be fairly simply done by:
Source:
/category/(.*)
Destination:
/$1
However, the base URL without the post-name must not be rewritten. So if someone access /category directly (without specifying a post-name) it should not redirect, because /category is a valid page. It should only redirect if something is following /category.
Example:
https://somesite.com/category -> Don't redirect
https://somesite.com/category/post-123 -> redirect URL to https://somesite.com/post-123
Any ideas how I can do this? Note: I am using the Yoast Plugin and its RegEx redirect option.
I am not a coder, so sorry for my gibberish. I hope I am making some sense.
Thank you! :)
Use .+ to match at least one character:
/category/(.+)
I need to create a regex Custom Redirect in Blogger. The purpose is to redirect all HTML archives to somewhere else.
Currently I'm using the following in Settings / Search preferences / Custom Redirects:
From:/2018_11_21_archive.html
To:/p/somewhere_else.html
Permanent:Yes
The problem is that this method requires to add every date, and that's not acceptable.
/2016_10_21_archive.html
/2016_10_22_archive.html
/2016_10_23_archive.html
/2017_07_10_archive.html
/2017_07_10_archive.html
/2017_07_10_archive.html
/2018_11_21_archive.html
/2019_11_21_archive.html
...
So far I've tried this regex with no success:
From:/2018_(.*)
To:/p/somewhere_else.html
Permanent:Yes
Blogger custom Redirects does not support regex.
But I have a solution for you, use this code, and put it after <head>
<b:if cond='data:view.isArchive and data:view.url contains "_archive"'>
<b:with value='"https://www.example.com/p/somewhere_else.html"' var='destination'>
<script>window.location.replace("<data:destination/>")</script>
<noscript><meta expr:content='"0; URL=" + data:destination' http-equiv='refresh'/></noscript>
</b:with>
</b:if>
You have to escape the "/" character! Just insert a "\" before.
This line must be like this:
From:\/2018_.*
But be aware that this way only /2018_11_21_archive.html will match.
If you need ALL dates as you mentioned, I recommend this regex below:
\/([12]\d{3}_(0[1-9]|1[0-2])_(0[1-9]|[12]\d|3[01]))_archive\.html
How do I redirect to remove all intermediate folders between the domain name and the .html file name without explicitly adding multiple rules per redirect.
basically I want both:
example.com/category/product.html
example.com/category/sub-category/product.html
to redirect to
example.com/product.html
I would also like:
example.com/category/subcategory.html
to redirect to
example.com/category.html
I don't have a logical way to differentiate between a subcategory.html and a product.html, so I am open to explicitly matching (or not matching) to list the sub-categories.
I would like to accomplish this for both apache and nginx styles of rewriting.
You can use these regex in this order:
^\/(category)\/(subcategory|subcategory2|subcategory3)\.html$ -> /$1.html for redirecting example.com/category/subcategory.html to example.com/category.html. See Online
^\/(category)\/.*?([^\/]+)\.html$ -> /$2.html for redirecting example.com/category/product.html or example.com/category/sub-category/product.html to example.com/product.html. See Online
You can replace category and subcategory with actual values.
Following Rounin's answer carefully written (thanks a lot) on how to redirect any blogspot urls with any extension to the mydomain.com corresponding URL, now the question is how can I mask the URL?
I mean, once the blogspot URL redirects to the mydomain.com, I want to continue to display the original blogspot URL instead of the mydomain.com.
You can use the following JavaScript snippet for that -
<script>
site = "http://example.com"; // The site which you want to mask, don't add ending slash
iFrame = document.createElement("iframe"); // Creates a iframe via JavaScript
iFrame.setAttribute("src", site + location.pathname); // Set the source of iFrame
iFrame.setAttribute("class", "maskingFrame"); // Add class to iFrame
document.body.appendChild(iFrame); // Append iframe to body of page
</script>
And the bare minimal CSS would be -
body {
overflow:hidden;
}
.maskingFrame, body {
width:100%;
height:100%;
border: none;
}
You can check a demo here (This is the homepage) and here (This is an internal URL from other site which doesn't exist on the original blogspot URL)
In privous answer you redirected page from blogspot to your domain. This causes the url to be changed. But if you want to show contents from another url without changing url it could be done through using .htaccess file.
the code in htaccess file should be like this:
RewriteCond %{HTTP_HOST} ^DomainA.com
RewriteRule ^(.*) http://DomainB.com/$1 [P]
Here you could find more details and info about .htaccess file.
I don't know if it is possible for you to place that file in your blog or not. If you have not access to place this file into your blog you can place it on your domain host, and redirect from your domain to your blogspot page but if ask me I recommend you redirect and encourage people to your own website rather than keeping them using weblog address. You'll not need weblog if you have your own website.
I'm trying to redirect from my old URL structure to a new one where in my case some parameters are added.
The old structure looked like www.url.com/detail/111.html which is rewritten from www.url.com?action=detail&id=111
Now the structure changed for SEO reasons, new the URL for the site mentioned above is something like www.url.com/detail/111/cat/sub.html.
Now i want to redirect from
www.url.com/detail/111.html to
www.url.com/detail/111/cat/xyz.html
or from
www.url.com/detail/112.hmtl to
www.url.com/detail/112/cat/abc.html
The last part in the new URLs is variable!
If im doing it with:
Redirect 301 /detail/112.html http://www.url.com/detail/112.cat/abc.html
the querystring ist added to the new url. The browser shows: http://www.url.com/detail/112.cat/abc.html?action=detail&id=112
When I'm adding a ? to the new URL the ? is also shown in the browser.
QSD doesn't work because Apache 2.2 is running.
Has anyone an idea what to do to solve the problem?
You can put this code in your DOCUMENT_ROOT/.htaccess file:
RewriteEngine On
RewriteRule ^detail/112\.html$ http://www.url.com/detail/112.cat/abc.htm? [L,NC,R]
Take note of ? at the end of target URL that is used to strip off any existing query string.