I wonder if i could change my URL from localhost/myproject/subject/1/ab-cd/tests into localhost/myproject/subject/ab-cd/tests (loss of id "1"). I want to hide the ID. Could it be done by using .htaccess?
Any helps will be appreciated.
Thanks you very much.
the question is not very clear enough to answer it properly. If id is being sent as GET request than it must be in the url....but you can still hide it:
by encryptring it in url
using sessions
by using AJAX
Hope so it helps
Related
I need to redirect https://example.com/projects/issues/(some_text_here) to http://example.com/i/(same_text_here) in such a way that it /i/(same_text_here) shows the same page that /projects/issues/(some_text_here) shows. Is this possible? How would I do this. Please post the code I would use (along with helpful comments explaining why something goes where it does). Thanks!
EDIT: I believe I would have to use the htaccess file?
EDIT 2: By (some_text_here) I mean so random text, like a wildcard. It could be /projects/issues/34... or /projects/issues/hello. In this case first example should redirect to /i/34, and the second example should redirect to /i/hello
Try this out in your .htaccess:
Redirect /projects/issues/ http://example.com/i/
I'm trying to create friendly url for my site but with no success :(( and i have two questions
The first is:
How to change the url from domain.com/page/something.php to domain.com/something
And the second is:
Will the changes make duplicate content and if how to fix the problem.
Thank you for your time,
Have a nice day
Check out the official URL Rewriting guide: http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
You'll be using the simplest use case, Canonical URLs. Assuming you have no other pages that you need to worry about, you can use a rule like this: (note: untested, your usage may vary)
RewriteRule ^/(.*)([^/]+)$ /$1$2.php
While that example might not exactly work for your use case, hopefully reading the guide and my example will help you get you on your way.
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.
At present my url structure of page is like this
Mysite.com/page-2
mysite.com/categoryname/page-2
I want to change it to
mysite.com/page/2/
mysite.com/category/categoryname/page/2/
Note that, I have multiple page, i.e. let's say a category have 100 page so I need to redirect all the earlier page number to the new url structure. Writing code of every url will be too tedious. I am not sure but using $ in the code can help.
Please let me know how can it be done via .htacess.
Thanks in advance.
Your URL structure is already with the desired one you have as I can see.
/category/telecom-news/page/2
For example, I want:
http://site.com/cool.php?page=woohoo
http://site.com/cool.php?page=yoyoyo
To show this in the browser:
http://site.com/woohoo/
http://site.com/yoyoyo/
How do I do this?
Check this answer: https://stackoverflow.com/a/8446690/995958
It gives a nice way to do exactly what you want to do.
Other answers are useful too if you have problems with the confirmed one.