When user access to my website with url:
example.com/post-name
Wordpress should perform 301 redirect to:
example.com/post-name/
But it's not working due the WP Rocket caching plugin (I couldn't find out why this is happening, but WP rocket is…
I've been trying to solve this for some time, and have tried a few suggestions which I found, but none of them seem to work
I would like to try and force a slash at the end of the URL for any page visited on my site, so rather…
The main problem client hasn't support redirection and can't generate URLs with trailing slash.
The backend uses openAPI and supports URLs only with a trailing slash. I am and kubernetes ingress in the middle. I can't change client or backend.
I am…
When we generate SEO reports, the SEO crawler detects some pages as having the trailing slash and others not, but only on some of our pages.
All our pages have a trailing slash.
But we don't understand why 301 redirects are done on the one that…
Hello I am trying to have the redirection done from domain.com -> domain.com/
Is there a way to accomplish this in Wordpress. I've been trying with htaccess, but httpstatus.io keeps showing 200, when actually it should show a 301 redirect.
It is…
This is the weirdest problem I have encountered. I am using mod_rewrite in .htaccess in Apache/2.2.13 (Linux/SUSE), and it appears to not be called when there is no trailing slash in the URL. I tested by putting garbage in the .htaccess file, and…
I want to build a search page for my application, and I am using .htaccess to make URLs look better. The search page is located at localhost/search. Furthermore, two optional parameters can be appended at the end of the URL, like this:…
Under Tomcat 9 src/main/webapp folder, I created a sub-folder named app containing an index.jsp file. If I request localhost:8080/app I get a 404 error, while with a trailing slash localhost:8080/app/ it works fine.If I disable spring mvc the…
Symfony 5.1
I'm updating some legacy code and I need the following routes to match:
/article/ <--- matches default page 1 and has trailing slash
/article/2 <--- matches pages 2 through n with no trailing slash
If I use the route annotation...
*…
I am using the following entry in .htaccess to add the trailing slash with the condition of !-f, which should add the trailing slash when it is not a valid file:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*[^/])$ /$1/ [L,R]
Now actually I…
How to add Trailing Slash at the end of directory only, not file?
example: with Trailing Slash:
https://www.mywebsite.com/directory/
example: without Trailing Slash:
https://www.mywebsite.com/file.php
I've perused the related questions, but I cant figure this little caveat out. The golden rule I've seen tossed around for trailing slash removal via mod_rewrite is:
RewriteRule ^(.*)/$ /$1 [R,L].
This is all fine and good, but it strips off the…
How do I return the string example.com using JavaScript if the input is https://example.com/page.html?query=string?
Right now, if I use window.location.hostname – or location.hostname – the return value isexample.com/, but I wantexample.com, without…
My website is working fine.
All controllers works fine unless I put a slash at the end the pages broke.
Here is oringal URL: Saaf.Pk
But when I put a slash at the end, style & images broked: Here
I know the problem is that URL path got changed. But…
I have installed WordPress multisite in sub-directory abc.com/en/. I want to remove the trailing slash for SEO purposes. So pages like abc.com/en/xxx/ will be 301 redirected to abc.com/en/xxx without a trailing slash.
After checking many resources…