开发者

how can I make an URL alias for my web page?

开发者 https://www.devze.com 2023-01-01 09:05 出处:网络
I have installed my website in a subfolder www.server.com/folder/index.php Is there any w开发者_StackOverfloway to hide \"folder/\" in my url ?

I have installed my website in a subfolder www.server.com/folder/index.php

Is there any w开发者_StackOverfloway to hide "folder/" in my url ?

The only solution I can think is to change Directory Root on the apache config file, but unluckily I don't have access to it

thanks

Update: all the solutions provided so far are not changing the url


make .htaccess file, and put this:

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.php$ http://www.server.com/folder/$1.php [nc]

everytime you access www.server.com/index.php will be redirected to www.server.com/folder/index.php


if you have your website installed on a server you can overlay it with a specific domain...

like www.example.com leads to www.server.com/folder/

In many backends it is an option to do this or even to say that www.server.com/folder/ is root directory


In online, use .htaccess file for change the folder path.


Can you create files on root?

Symbolic link

You could create a symbolink link on your root directory:

ln -s /folder/ index.php
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号