Link to home
Start Free TrialLog in
Avatar of doctorbill
doctorbillFlag for United Kingdom of Great Britain and Northern Ireland

asked on

http redirects

I have an xampp (Apache) server setup such that the Wordpress files are in the following directory:
htdocs/Wordpress

If I use http://localhost/wordpress the site works perfectly well
I need to be able to type in the public website address such that the original request is diverted to the Wordpress/Index.php file rather than typing http://mydomainname.com/wordpress

ie. http://www.mydomainname.com
This should then reference the Wordpress/Index.php file

Please can someone tell me how to achieve this - .htaccess?, redirect ?
I need clear instructions please as I am not familiar with the apache server setup
Avatar of David Favor
David Favor
Flag of United States of America image

https://www.experts-exchange.com/questions/29137540/How-to-Get-Apache-on-MAMP-Pro-to-only-server-HTTPS.html provides one way to accomplish this, which also handless upgrades to HTTPS also.

Be sure to always use 302s, else you'll always be fighting with browser caching issues...
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of doctorbill

ASKER

I tried this but I get a page not displayed

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?inventas.co.uk$
RewriteCond %{REQUEST_URI} !^/wordpress/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /my_subdir/$1
RewriteCond %{HTTP_HOST} ^(www.)?inventas.co.uk$
RewriteRule ^(/)?$ my_subdir/index.php [L]
</IfModule>
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Aaaahhh
Sorry - missed those
Now all ok

Another cheaky question - how to add an ssl to an apache (xampp) server
Another cheaky question - how to add an ssl to an apache (xampp) server
Best to ask that in a separate question.
ok