I want to show the URL
http://www.example.com/store?department=id_motocycle
as
http://www.example.com/store/motocycle
how can i do using .htaccess ?
Related
I want to redirect a URL from an old site with this format:
http://www.domain.com/us/productos/producto.asp?id_g=1&ID=2
To this new format:
http://www.domain.com/usa/products/name/
How can I do this? I tried with this:
Redirect 301 /us/productos/producto.asp?id_g=1&ID=2 http://www.domain.com/usa/products/name/
But it didn't work. I think it's because the ? and & symbols of the original URL. For example, this is working in other URLs without this symbols, like this:
Redirect 301 /caste/home/home.asp http://www.domain.com/es
Do you use a php framework?
If you use php framework like codeigniter, setting like that is not in .htaccess, but in application/config.php
Now, You use asp (because your url), you better look first at this link
or you can find google with keyword asp routing or asp pretty url
I would like to add a line to my htaccess to change this url:
RewriteEngine on
do this is the url
http://site/Calendar/viewevent?eventid=9223
into something like this :
http://site/Calendar/viewevent/Title-of-event
its php and joomla and I am a php developer, please dont advise me to use a component or module to handle redirects, I am trying to achieve this using .htaccess ONLY :) thank you in advance!!
Your 'pretty' url contains information that is not in the 'working' url. Besides that, the 'working' url also contains information that is not in the pretty url. You need database access to translate the event id to a seo-title, and the seo-title back to an event id. In other words: It is impossible to do this with .htaccess only, unless you change 'viewevent' to accept an event by seo-title, instead of eventid.
Mod_dbd can possible be used, but only in the server config file, not .htaccess.
As Sumurai8 says htaccess cant transform url like you want automatically.
But you can use Redirect 301 (or its variation) for one url to another.
for your example:
Redirect 301 /Calendar/viewevent?eventid=9223 /Calendar/viewevent/Title-of-event
more information here
How would I do this please? I am having problems with my htaccess.
suppose I have this url:
www.testingstackzz.com/index.php?action=list&lcp=19
and I want to redirect it to a custom url which I made up like this
www.testingstackzz.com/general/place
where 'place' in the above url is the name for the variable lcp=19 in the database. So lcp=20 would be another place to be more explicit.
In your index.php script, look for the $_GET['lcp'] parameter, look it up in the database, then use header("Location: /general/$name_of_place");
If you only want to limit this to request that directly access the index.php file, then check the $_SERVER['REQUEST_URI'].
for e.g. my domain is www.examples.com and subdomain is test2.examples.com
I am using url variable to link pages.
e.g.test2.examples.com/index.php?page=registers
but I want clean url like
test2.examples.com/page/registers
How can I do this using HTACCESS file.
can I use HTACCESS for subdomain or it will not allow
You are looking for URL Rewriting, it will answer all your needs., see this URL Rewriting Guide
I'm using cpanel and tried using htaccess and it's not working.. I need to redirect prismafoto.com.ar to brujaurbana.com.ar/prisma but when it does the url that is shown is brujaurbana.com.ar/prisma
How can I do this?? thanksss :(
Sounds like you are wanting to do a masked URL redirect. Meaning, you want the domain to redirect but stay the same in the URL bar.
http://webstarthelp.com/forwards.html
The above site has a great Masked URL Redirect.
Simply create a index.html file on prismafoto.com.ar and paste the generated code.
Make sure to clear the .htaccess file so redirects do not conflict.