Question how do i rewrite
http://www.mywebsite.nl/support/department/index.php?/Ontruimingsvonnis/Knowledgebase/List/
to
http://www.mywebsite.nl/support/knowlegdebase/list
i have tried different ways to solve it but sofar no luck. Me and htaccess just aint friends.
Who will be able to help me out with this is need a 301 redirect for this one?
Could it also be that the index.php? would give a problem here?
Thanks in advance,
Paul
My Memory is a little hazy on this (its been a couple of years since i had to do this) but i believe mrewrite is what you need to use.
After a little digging, i found the page that might be helpful
http://www.workingwith.me.uk/articles/scripting/mod_rewrite
Related
I've had a look at all kinds of online resources and can't quite work this out.
Would really appreciate a well explained answer so I can work this out and help others with it too!
I have this structure:
website.com/blog/year/month/day/blog-title/
and I need to create a 301 redirect removing the blog and date like so:
website.com/blog-title/
I've been trying all kinds of combinations of letters that I don't really understand without any luck.
Any pointers greatly appreciated,
Thanks!
I've been searching around and tried many different ideas to fix the state of a URL for my client, but have had no joy.
The URL currently looks like this:
website.com/folder1/folder2/folder3/page.php
My client wants this to be showing much like the other links on the website as so:
website.com/page
I'm fine with removing the .php that's simple enough and is already written into my .htaccess file. It's just removing the 3 directories from the URL is what I cannot work out.
Before anyone asks about moving the file to a higher directory, I'm afraid this cannot be done as everything needs to be down in this 3rd directory for this page.
I believe my latest attempt is about the closest I've got to solving this, if anyone could point out my mistakes and a solution it would be much appreciated:
RewriteRule ^/folder1/folder2/folder3/(.*)$ /page$1 [L,R=301]
EDIT:
After researching more today, I think I may have confused people with this question. I think what I should have said is that I need to mask the URL, hiding the 3 directories, and showing just the domain and the page itself.
I still seem to be hitting a wall with masking too. Any advice?
After a whole weekend (and quite a bit of the week between working) I finally managed to succeed with what I wanted.
The site now displays as required:
website.com/page
Which has been redirected and masked from:
website.com/folder1/folder2/folder3/page.php
The piece of code required in the .htaccess is as follows:
RewriteRule ^page$ /folder1/folder2/folder3/page.php
Looks like I was being stupid before and had the syntax backwards, but all is well now and I'm allowed to sleep :)
Hope this helps anyone else in future with this sort of problem!
I am wondering if this is possible to do with an .htaccess rule.
My beginning url:
http://cmfi.org/wherewework/missionary/?missionary=ttaho%2C
What I want to end up with:
http://cmfi.org/wherewework/missionary/ttaho
The ttaho will change according to the page.
Thanks for any input.
Don't think I was asking anyone to code this for me...Just asking if it was possible. I have tried a few things and couldn't get them to work. The %2c is an encoded part of the url that is added from the plugin I was using.
I will figure it out. No worries.
I'm trying to redirect just one page on a site to another one using htaccess. I'm new to this, but have been reading and reading everywhere to figure out how to do this, but without success.
I would like to redirect www.example.se to www.example.se/index.php?template=<templatename>
Is that possible and how would I approach that? So sorry if I'm asking a stupid question here, but really can't find a solution and it's driving me crazy.
Try:
Redirect / /index.php?template=<templatename>
Add a 301 right after Redirect if you want it to be permanent.
I'm pretty inexperienced with .htaccess so please bear with me.
I have a domain - "http://www.exampletest.com"
which redirects to a folder at a different domain where I have hosting i.e:
"http://www.differenturl.com/exampletest"
Is there an easy mod_rewrite rule where I could have anything at "http://www.differenturl.com/exampletest" show up as "http://www.exampletest.com?" An example would be:
"http://www.differenturl.com/exampletest/user.php" -> "http://www.exampletest.com/user.php"
Any assistance is greatly appreciated. I assume this easy so sorry to ask such a basic question.
Thanks
You say "rewrite, not redirect", so no, there isn't a simple way to do this. The only way to do what you ask would be to have a "reverse proxy" running on www.exampletest.com that fetches content from "www.differenturl.com/exampletest/". That isn't something you can do with mod_rewrite.
If I have understood correctly, following code might do:
RewriteRule exampletest/(.*)$ http://www.exampletest.com/$1 [R=301,L]
Please note that you add this line in the .htaccess file placed on differenturl.com server.
Hope that helps.
Cheers