url rewrite in php using web.config - url-rewriting

i want to rewrite this url "demo/demo/index.php" to "demo/demo/send.html" in php using web.config file.
I did this url rewrite by using htaccess file
Please somebody help me....

would something like this work?
RewriteEngine on
RewriteRule ^demo/([a-zA-Z0-9_-]+)/([0-9]+)\.html$ index.php?id=2
There really isn't much to go by from your question.

Related

How to setup URL redirect in Cyberpanel (Lightshot)

I am trying to rewrite URLS in my website but unable to do so.
I am using Lightspeed in Cyberpanel. The .htaccess code I used is:
RewriteRule ^([^/d]+)/?$ index.php?id=$1 [QSA]
What my url looks right now: mysite.tld/index.php?a=2322
What I want to look it like: mysite.tld/2322
Thanks in advance!

How to rewrite URLs in PHP using .htaccess, I have tried it but it's not working?

can anyone please help me to rewrite url in php...
http://localhost:81/cabnotels/Domestic-tours/tour.php?Delhi&india%27s-golden-triangle-tour&type=tour&id=19
This is the current URL and I want to rewrite as..
http://localhost:81/cabnotels/Domestic-tours/tour/Delhi/india's-golden-triangle-tour/tour/19
Please help..
Thank you in advance.
You can not use comma in your url like you have in (india's) and you can rewrite your url using the htaccess like:
RewriteRule ^cabnotels/domestic-tours/tours/([^/]*)/([^/]*)/tour/([^/]*)$ tour.php?$1&$2&$3&$4 [QSA,L,NC]
OR Simply if you have only one URL:
RewriteRule ^cabnotels/Domestic-tours/tour/Delhi/indias-golden-triangle-tour/tour/19$ cabnotels/Domestic-tours/tour.php?Delhi&india%27s-golden-triangle-tour&type=tour&id=19

.htaccess rewrite image urls

I'm trying to figure out how to redirect all image urls like this:
https://example.com/images/FILE.PNG
to this:
https://example.com/old-site/images/FILE.PNG
Is there an easy way to do this with .htaccess? I've looked around, but couldn't find a post anywhere with a similar scenario of adding a sub directory and don't understand htaccess rules well enough to write it myself.
Any and All help is appreciated!
Using URL Rewrite in .htaccess:
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^/?images/(.*)$ /old-site/images/$1 [R=301,L]
You can use this one-liner rule in your root .htaccess:
RedirectMatch 301 ^(/images/.+)$ /old-site/$1

Better URL with mod_rewrite?

Please, help me with this. I have my website in a directory /domains/mywebsite.com and I am using mod_rewrite to access the website, but the URL looks then like this:
http://www.mywebsite.com/domains/mywebsite.com/something
So please how can I get off the /domains/mywebsite.com/ part from the URL?
Is there any other way how to make it possible except changing the public $live_site in the configuration.php (in Joomla)?
You could use this:
RewriteEngine On
RewriteRule ^(.*)$ /domains/mywebsite.com/$1
But I agree with Bakual's suggestion that this is not a great way to address the problem. Better to reconfigure your server so that it makes the /domains/mywebsite.com/ directory the public root directory for that domain.

How to solve TinyMce image manager Network Error

It was working until my hosting do some changes to server. I don't know what changes they have made.
request is: click here
or
http://mysite.com/tiny_mce/plugins/imagemanager/js/compressor.php?classes=mox.Event,mox.List,mox.DOM,mox.geom.Point,mox.geom.Rect,mox.String,mox.dom.Drag,mox.tpl.Template,mox.tpl.Paging,mox.data.ResultSet,mox.net.Cookie,mox.ui.WindowManager,mox.ui.Menu,mox.ui.MenuItem,mox.ui.DropMenu,mox.ui.DropMenuItem,mox.dom.Layer,mox.dom.Tween,mox.net.JSON,mox.dom.Form,mox.util.Dispatcher,moxiecode.manager.BaseManager,moxiecode.manager.ImageManager,moxiecode.manager.DevKit
it returns NetworkError: 404 Not Found
if i remove mox.net.Cookie and mox.net.JSON by hand from the querystring it works.
What should be the problem? How can i solve it.
I use CodeIgniter.
Thank you.
If you're using .htaccess it may be possible you're heading to a CI controller rather than the file you're looking for.
Here is an example mod_rewrite rule that might help. Often it's worth checking your access log to see which file is being called also.
RewriteEngine on
RewriteCond $1 !^(index\.php|assets|media|favicon\.ico|ipadicon\.jpg|tiny_mce)
RewriteRule ^(.*)$ /index.php/$1

Resources