fixed url on address bar - show only base url http://www.mysite.com - apache

I need to show on the address bar just the first part of the url of my site.
For example for any page with name like
http://www.mysite.com/mypage.php or
everything else
I want to see just http://www.mysite.com on the address bar of the browser.
How this can be achieved?
I tried with apache RewriteRule but with no result.

Apart from being a really bad idea for people actually trying to use your site, there is no way you can do this on the server side, because the server needs to know which page was accessed - that's what a URL is for. What you are looking for is to make it appear to the user that they are still at the same URL.
This is easy enough if you put your entire site in an HTML frameset with one frame, or an iframe sized to fill the browser window. This does require all external links to have target="_top", and without additional JS people can break out of the frame and access the pages individually anyway.
An alternative approach, that will only work on some browsers, would be to use history.pushState to fake the address bar back to / every time a new page loads.

Related

Images are not displayed properly in .net 5

In one control I try to display images using JavaScript. Everything is fine as long as I am in the URL controller
https://localhost:44300/Campaigns
But when I refer to the index, the images are not displayed, even though I am on the same page or after the Redirect ("Index").
https://localhost:44300/Campaigns/index
The root address does not seem to be working properly
This is my image address when it works properly in Campaigns
https://localhost:44300/uploads/f09ef469-0893-4089-8491-78707d097b0e.jpg
This is my image address when it does not work properly in Campaigns/Index
https://localhost:44300/Campaigns/uploads/f09ef469-0893-4089-8491-78707d097b0e.jpg
The CSS and js address images in the layout work well, and I used UseStaticFiles() in the Configure.
It is because you are referring to the images with a URL that is relative to your current page. You need to use a URL that is relative to your site root. You can change this by prefixing the URL with / where you are constructing them.
Eg instead of something like
uploads/f09ef469-0893-4089-8491-78707d097b0e.jpg
Use
/uploads/f09ef469-0893-4089-8491-78707d097b0e.jpg

Accessing subdomain while trying to keep entered URL in address bar and append filepath

I have a Prestashop install in a folder (which also is a subdomain) on my server.
Currently Visitors visit www.spine-design.co.uk.
They are shown the data in www.connive.co.uk/Spine (also accessible via spine.connive.co.uk)
The address bar defaults to www.connive.co.uk/Spine/(content)
I'm after a way of having the address bar keep www.spine-design.co.uk whilst appending any further filepath to the end.
Ultimately I want to be able to change prestashop's URL & SEO settings so that all generated links/addresses show www.spine-design.co.uk as well. Currently it has to be set to www.connive.co.uk/Spine otherwise it just displays a white, blank screen when accessed.
I'm and experienced front-end designer/developer, delving into .htaccess and re-directs for what is essentially the first time.
I've tried various .htaccess rules, even used some generators and not had the result I'm after.
If I'm honest, I'm not even sure if .htaccess is the best route to go down to get what I require.

Redirect .htaccess to different page on different domain

I tried searching for similar posts but none of them satisfied my need. Hence I have to ask a new question
I have some domain space on my university website like this <university>.edu/~<myname> which is actually <university>.edu/~<myname>/index.html
I want all the traffic from here to go to <myname>.wix.com/resume. But I don't want other pages like my <university>.edu/~<myname>/somethingelse to redirect anywhere.
Also I want the address bar to still show <university>.edu/~<myname> even when it has readirected to my site on wix.com.
Kindly let me know if this is possible.
Thanks in advance.
No browser that I know of will allow itself to be redirected to a different site, without displaying the URL of the new site in the address bar. However, there are ways that you can display content from <myname>.wix.com/resume on your page at <university>.edu/~<myname>/index.html. One way is to use a frame (or an iframe) on <myname>.wix.com/resume which would load content from <university>.edu/~<myname>/index.html. Another (perhaps more seamless) solution would be to use a server-side scripting language (such as PHP) to create a script at <university>.edu/~<myname>/index.php which would download the content 'on the fly' from <myname>.wix.com/resume and display it at <university>.edu/~<myname>/index.php.

how to prevent changed url in the browser bar from reflecting in the website content?

how to prevent the change in the url of the browser bar from reflecting in the website content's URLS...
here is the situation,
in my current web app, I am using this
$this->createUrl(Yii::app()->controller->id ."/". Yii::app()->controller->action->id, $params)
to generate href of the hyperlinks... now the problem is,
when I type in the browser bar like e.g
www.mysite.com/blahblahblah/subcategory/c1
the blahblahblah, also reflects to the webpage content hyperlinks,because of the Yii::app()->controller->id that I passed to the createUrl function...any work around for this ?..., what i want to happen is, no matter what string is typed in the place of the controller name via the browser bar, it won't reflect in the webpage content hyperlinks ..
so how ?
the answer was, I took the ID from the URL ,created a simple Helper function and used that to return the correct value of category/subcategory and outputs it in the view source no matter what change is done via the browser bar

Bring Safari to front

I'd like to bring Safari to the front (switch to) but without using a URL, instead I'd like to see the "pages" view so the user can pick an already loaded page. Is this possible?
We open links in Safari and if the user returns to the app and selects the link again, I'd rather let them pick which Safari page to browse instead of opening a new one. I know that if the same URL is called it will open the correct page but the user may have navigated within the original site so the url no longer matches.
Thanks,
Rick
I don't think that its possible, i would use a UIWebView inside your app in order to get that experience you want, you can find the UIWebView apple docs here (http://developer.apple.com/library/ios/documentation/uikit/reference/UIWebView_Class/Reference/Reference.html) and also the equivalence of c# methods here (http://tirania.org/tmp/rosetta.html) hope this helps
Alex
Your app doesn’t get control of Safari’s UI. You might, however, be able to design your site so that it handles navigation via Javascript—AJAX and whatnot—so that the actual page URL doesn't change, and thus so that the page, re-opened from your app, brings up the existing Safari page. Of course that introduces further problems with your pages no longer being bookmarkable, but you might find that an acceptable tradeoff.