silverstripe slash in url file location - silverstripe

I recently came across this post on removing the slash in the URL which is what I am trying to achieve.
Silverstripe hash link rewriting putting unwanted slash in link
I was hoping someone might be able to expand on the answer given?
Reason:
I'm struggling to find the file location to carry out the edit on SS version 3.2.1
I'm new to SS and creeping along in the slow lane at the moment.
Thanks!

Related

Redirection from subfolder to another

I've a situation which I'm going nuts trying to fix.
I need to redirect anything in one folder to its new location at another folder.
Via htaccess, that is.
Site.com/event/ >>> Site.com/sub01/event/
For a slightly more in-depth explanation of what I'd done, just in case it's needed:
I had a wordpress installation (inside a subfolder resolving to the root of the domain).
I then moved that installation to a new folder as so:
Site.com/sub01 >>> Site.com/sub02
That second installation now resolves to the root with the original now resolving to its own folder.
I left behind one folder /event/ with over 6,000 posts. Which ends up no longer located where it once was since it no longer resolves to the root. Follow?
Thus the reason behind needing the redirect. So that SE or actual person looking for that old address can still find it.
BTW, I've tried all sorts of code I'd found online...none of which worked. :(
====================
In response to Amit's question below,
Thanks for the reply Amit,
I've tried the following codes:
RewriteRule ^event/(.*)$ /sub01/event/$1 [L,NC,R=302]
RewriteRule ^event/(.*)$ /sub01/event/$1 [R=301,NC,L]
RewriteRule ^/event/ /sub01/event/ [R=301,L]
Mind you I've no clue what I'm doing in as far as this code's concerned.
Merely answers I found to other folks' similar questions.
As for what didn't work? Well, nothing changed at all except for simply, a page not found.
Thanks in advance to anyone with any input and insight.
Okay, I finally came across the answer.
It came through the use of Cpanel's Redirect Tool. I had no idea that solutions created that way are reflected through the htaccess found at the root of the domain.
But even that didn't work until I took the instructions inserted by Cpanel and moved them above all other instructions within the htaccess file.
Thanks folks for putting up with my ignorance in posting properly on this site.
Cheers! :)

How to locally link pages in worldpress

We are currently building a site on our server that will eventually take over a current site. The problem we are running into is that all of our hyperlinks will change once we transfer over to the new site. Is there a way to link pages without hard coding in the URL?
You will probably want to use mod_rewrite to rewrite your URL from the old format to the new format. You might start at http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html. If you search on mod_rewrite, you will be able to find lots of examples and tutorials to help you.

How to figure out file path redirection for images using 301 redirection with htaccess?

I'm having a weird redirection issue and can't figure out how to solve it. I installed my Wordpress in a directory (called /Cafe/ ) for my KatsCafe.org website and all the posts are being redirected just fine. But a huge number of my images are messed up. They won't redirect without the /Cafe/ in the URL, while none of my older URLs for images included a directory. My site is graphic/image heavy and many of them show up in Google Image searches so I am losing a lot of traffic over this.
I can't figure out how to redirect from two separate file paths to the current one.
My oldest file path was from when I installed Wordpress in the root directory with a previous host, so image from that installation would have the file path:
Http://katscafe.org/wp-content/uploads/year/month/name-of-file
to the current image file path, which would be:
Http://katscafe.org/Cafe/wp-content/uploads/year/month/name-of-file
I have another less important redirection I am having a few errors from as well, stemming from the short while I tried out a multisite option (silly me, I thought I would enjoy not having to handle updates, etc ... but I'm entirely too OCD to enjoy that, LOL). Since that meant that my files were in a multi-site directory listing, the file path would have been:
Http://katscafe.org/files/year/month/name-of-file
and still needs to forward to the current image file path, which again, is:
Http://katscafe.org/Cafe/wp-content/uploads/year/month/name-of-file
I'm not sure if I am overlooking an obvious tool that can help me figure this out, but every tool I've found involves post redirection, not a file path type of redirection. And even then I'm not entirely sure of my ability to figure it out completely.
I would be forever grateful for any help with this! Thanks so much!

Nginx rewrite rule

I need a rewrite rule for an nginx server. I'm using joomla 1.5 with sh404sef component to make clean urls.
Now i have installed gtranslate module to make the website multi language. So after installing the module my url's will change.
for example
My orginal url:
http://mywebsite.com/index.php?page=shop.product_details&flypage=flypage.tpl&product_id=511&option=com_virtuemart
the sh404sef component will change this to
http://mywebsite.com/men-s/coverall-shirt-in-grey.html
But after installing gtraslate the urls changed like this
I want to replace a url to something different. for example:
http://mywebsite.com/index.php?/ja/page=shop.product_details&flypage=flypage.tpl&product_id=511&option=com_virtuemart
here i have enabled japanese language, so there is a additional string /ja/ added in the url.
This is making problems in the website.
I want a rewrite rule for nginx to replace this url to orginal one without ja
Does anyone have an idea.
Please help me..
--
Thanks in Advance
Tibin Mathew
if you rewrite the url in ngingx your joomla will never receive the /ja request, and consequently will never server the translated content.
you'll have to make the sh404sef component work with the gtranslate url's instead
http://gtranslate.net/forum/gtranslate-fully-compatible-with-sh404sef-t2168.html indicates this should be possible, but doesn't say how

Wordpress trailing slash in permalink address causes a 404

For some reason my Wordpress install now requires a trailing slash after the page name.
For instance http://somedomain.com/page-name (404's)
Yet http://somedomain.com/page-name/ (serves the correct page)
I wonder whether this is just because of a stricter Apache server on the remote server i've just uploaded it too, compared to that of my local environment.
Needless to say though it would be great to get a suggested fix in place :)
Please check below links.
wordpress mu 404 without end slash
http://yamz.wordpress.com/2009/09/21/trailing-slash-in-wordpress-permalink-causes-404-error-in-ie/
It will work , sure..

Resources