Posts

Showing posts with the label .htaccess

How do i change the .htaccess on cPanel's Online File Manager (ByetHost)?

Image
Clash Royale CLAN TAG #URR8PPP How do i change the .htaccess on cPanel's Online File Manager (ByetHost)? I'm using ByetHost as my website's FTP service, i configure everything (besides uploading the stuff) via ByetHost's Vista Panel, which has a Online File Manager where i presume i could edit the .htaccess. However when i arrive at the File Manager, i can't seem to find the .htaccess file, and there is also a lack of a Settings button too. Here is what the File Manager looks like: (the htdocs is where all my website's stuff is at) I know ByetHost and/or whatever this unknown File Manager is not well known, but i'd like to ask anyways if there's anyone that could help me on how to configure my .htaccess. I would appreciate it. 1 Answer 1 I had this issue too, and couldn't find any settings or otherwise. So what I simply did was: Just created a new file and named i...

wordpress wp-content/uploads folder 301 redirect to S3 bucket by cloudfrond CDN by .htaccess issues

Image
Clash Royale CLAN TAG #URR8PPP wordpress wp-content/uploads folder 301 redirect to S3 bucket by cloudfrond CDN by .htaccess issues See below, the .htacess file from wordpress. If I remove the part starting from #begin Wordpress. All the image file url will be change to d28rt1vkpsdxas.cloudfront.net/someimage.png successfully. However, all the internal link will be unable to access(only the home page can access). The error is Not Found The requested URL /shop/ was not found on this server. But if I keep the part start from #begin Wordpress. The cdn redirect will not work any more. All photos are missing. Thanks in advanced. Options +FollowSymlinks RewriteEngine on Rewriterule ^wp-content/uploads/(.*)$ http://exampled28t1vkps.cloudfront.net/$1 [r=301,nc] # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END Wo...

htaccess redirect url with special characters (+)

Image
Clash Royale CLAN TAG #URR8PPP htaccess redirect url with special characters (+) I have a URL like this. http://olddomain.com/product-category/x-tended+bottoms/ and I wanted to apply a 301 redirect via htaccess to http://newdomain.com/shop/extended-bottoms However, when i'm trying to apply a rule that goes like this, it doesn't take effect and instead lands me to page not found. RedirectMatch 301 ^/product-category/x-tended+bottoms/(.*)$ https://mothersenvogue.com.hk/shop/all-bottoms? RedirectMatch 301 ^/product-category/x-tended+bottoms/(.*)$ https://mothersenvogue.com.hk/shop/all-bottoms? What regex can I use to change the plus sign (+) on the url? 1 Answer 1 So I was able to find a reference answer to my question by adding the highlighted rule to check the plus sign (+) on URLs: RedirectMatch 301 ^/product-category/x-tended**[s+]**bottoms/$ https://newdomain.com/?$ htaccess redirect a plu...

htaccess redirect and rewrite rules conflicting

Image
Clash Royale CLAN TAG #URR8PPP htaccess redirect and rewrite rules conflicting I want to rewrite all requests to index.php?r= So that /sth becomes /index.php?r=sth I have applied this rule that works: RewriteCond %{REQUEST_URI} !^/index.php$ RewriteCond %{REQUEST_URI} !^.*.(jpg|css|js|gif|png|pdf|php)$ [NC] RewriteRule ^(.+)$ index.php?r=$1 [L] However I want to also have redirects such as Redirect 301 /sth /sth-new What happens is that it works but the url becomes: /sth-new?r=sth Do you have any solutions - suggestions about why this is happening? How can I implement a global rule and also have simple redirects? 1 Answer 1 You can do it like this: RewriteRule ^sth/?$ /sth-new? [L,R=301] RewriteCond %{REQUEST_URI} !^/index.php$ RewriteCond %{REQUEST_URI} !.(jpg|css|js|gif|png|pdf|php)$ [NC] RewriteRule ^(.+)$ index.php?r=$1 [L] You should keep external redirect rules before your internal rewrite rul...