Tag Info

New answers tagged

0

This looks like there has been a change in the way PHP is being run on the server. Either because the host has updated/migrated the server or because of a user configuration change. Some hosts allow the user to change the version of PHP being run via an option in cPanel. AddHandler fcgid-script .html FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .html This ...


3

RewriteRule ^login$ /login.php? [L,R=301] You need to remove the ? on the end of the RewriteRule substitution. This is effectively creating an empty query string, removing anything that is passed in the request. RewriteRule ^login$ /login.php [L,R=301]


1

Problem is, when I want to open these files via my website, I get an error, because the link to the file is a direct link An ordinary link on your website is not a direct link. If the browser is sending any referer at all then when a user clicks a link on your website then the referer is "your website". If you are not getting a referer header in this ...


1

I figured out how to solve the second part of the question where the ID= was found at the end like the following: example.com/index.php/archived-content?id=206 by adding a line to the .htaccess like: RewriteCond %{QUERY_STRING} ^id=206 RewriteRule (.*) /some-file-name.php? [R=301,L]


3

This assumes that p, id or catid always appears at the start of the query string, and that the value of this parameter is the "file" basename in the new URL, as per your code examples. RewriteEngine On RewriteCond %{QUERY_STRING} ^(p|id|catid)=(\d+) RewriteRule ^$ /%2.php? [R=301,L] The ^$ pattern only processes requests for the document root (ie. ...


1

Even cPanel File Manager shows the same thing. In the popup dialog that opens before getting to the file manager itself you need to make sure that "Show Hidden Files (dotfiles)" is checked. Unfortunately, if you've previously checked "Skip this question" or you simply don't get this option then a similar option does not seem to be available in the ...


1

On the end of the URL when in the file manager, add &showhidden=1. This will show you hidden "dotfiles" (Files beginning with a .) Like so: https://example.com:2083/cpsess1234567890/frontend/x3/filemanager/index.html?dir=/public_html&showhidden=1


0

https://gist.github.com/sabbour/e49b3ac9e1438c93d5fb Just create a web.config file on Notepad or edit the one you have on the root folder of Magento, and copy and paste this: <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="Remove index.php ...


1

You can redirect your site from www to non-www version by 2 diff. ways : First Method is RewriteCond %{HTTP_HOST} ^www\.example\.com [NC] RewriteRule ^(.*)$ http://example.com/$1 [L,R=301] You can use above code in you Htaccess. But it will be something like hardcoded code as you have to specify domain name. It will work fine. Second Method is : ...


-2

check this link.. https://developers.google.com/webmasters/mobile-sites/mobile-seo/configurations/separate-urls?hl=en (Annotations for desktop and mobile URLs).


0

You are looking for something pretty similar to me. This code worked (it redirects the user to a new link) but it needs some polish Options +FollowSymlinks -MultiViews <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^(.*)\.example\.com RewriteRule ^(.*)$ /%1-index.php [L,NC] </IfModule> So this should redirect ...


2

Have mod_rewrite installed and try this: RewriteEngine On RewriteCond %{REQUEST_URI} !^(.*).png [NC] RewriteCond %{REQUEST_URI} !^(.*).jpg [NC] RewriteCond %{REQUEST_URI} !/index.html [NC] RewriteCond %{REQUEST_URI} !^(.*).css [NC] RewriteRule ^(.*)$ - [R=503,L] ErrorDocument 503 /index.html Header always set Retry-After "604800" The 4th line checks the ...


4

In your root .htaccess, using mod_alias: Redirect 301 /home / However, if you are already using mod_rewrite (very likely that you are if this is still a Joomla site) then you should use mod_rewrite: RewriteEngine On RewriteRule ^home/(.*) /$1 [R=301,L] Nothing else to do in Google Search Console (formerly known as "Google Webmaster Tools").


0

As you have done with your current rules, you need to make an allowance for any files that end in .jpg or .png. So for example, I think your redirect match would be: RedirectMatch 503 ^/(\.(html|png|jpg|jpeg|gif)|~)$) This has the added benefit that it will catch any html file that's being called during maintenance mode. I haven't tested the above, but ...


1

RewriteRule ^test-music\.html$ /music/ [L,R=301]


1

Very easy, this is something you can easily find and figure out yourself. # Check if the url STARTS WITH (is what the ^ does) '/test-music' RewriteCond %{REQUEST_URI} ^/test-music # redirect it, 301 style, Last line (we go away, no need to do the rest of the htaccess) RewriteRule ^(.*) /music/ [L,R=301]


-1

Why not create example.com/store/imdex.php and have one line of code header("Location:../index.html"); Or if for some odd reason you can't create a php script, do a meta refresh <meta http-equiv='refresh' content='0;url=http://example.com'>


2

RedirectMatch 301 ^/store/$ http://example.com it only redirects example.com/store/ (with forward slash after store) Which is exactly what the "forward slash after store" is saying in your RedirectMatch pattern. However, you should not mix RedirectMatch (mod_alias) with RewriteRule (mod_rewrite) redirects. Different modules execute at different times, ...


0

I actually solved it by turning off any PHP code after my coding in html... so that the server doesn't add any of it by itself



Top 50 recent answers are included