modifying htaccess for localhost with a custom port

admin2025-01-07  4

I have a live instance of wordpress which I'm attempting to spin up on my local machine using xampp. A brief summary of steps to where I'm currently at:

  1. configured xampp to use a custom port (8012)
  2. downloaded the latest files and database
  3. added the entire public_html file to my new directory ('support') within xampp: C:\xampp\htdocs\support
  4. Modified all instances of the live URL to my localhost URL localhost:8012/support in the database
  5. Uploaded the database to phpmyadmin
  6. updated the wp-config with the traditional username,pw and new localhost:8012 URL
  7. made a few slight tweaks to the php.ini files and phpmyadmin config.default file so there isn't any limits

...and boom! stuck. when i attempt to load localhost:8012/support, I should be greeted with a login page. Instead, I'm getting a continual load and then timeout.

I've had this working before, and remember that I have to modify the .htaccess file but every attempt at updating this file in the rewrite module section, is resulting in the same outcome. I'm 99% certain this is the issue. This is what it's currently set to - any ideas?

RewriteEngine On
RewriteBase /support/
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule .localhost:8012/support [L]
</IfModule>

I've updated both the RewriteBase and RewriteRule with several different versions (including http:// and including index.php), but still breaks/doesn't load. I've no prior knowledge around this, so a little help as to what value should go here should go here would be appreciated.

I have a live instance of wordpress which I'm attempting to spin up on my local machine using xampp. A brief summary of steps to where I'm currently at:

  1. configured xampp to use a custom port (8012)
  2. downloaded the latest files and database
  3. added the entire public_html file to my new directory ('support') within xampp: C:\xampp\htdocs\support
  4. Modified all instances of the live URL to my localhost URL localhost:8012/support in the database
  5. Uploaded the database to phpmyadmin
  6. updated the wp-config with the traditional username,pw and new localhost:8012 URL
  7. made a few slight tweaks to the php.ini files and phpmyadmin config.default file so there isn't any limits

...and boom! stuck. when i attempt to load localhost:8012/support, I should be greeted with a login page. Instead, I'm getting a continual load and then timeout.

I've had this working before, and remember that I have to modify the .htaccess file but every attempt at updating this file in the rewrite module section, is resulting in the same outcome. I'm 99% certain this is the issue. This is what it's currently set to - any ideas?

RewriteEngine On
RewriteBase /support/
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule .localhost:8012/support [L]
</IfModule>

I've updated both the RewriteBase and RewriteRule with several different versions (including http:// and including index.php), but still breaks/doesn't load. I've no prior knowledge around this, so a little help as to what value should go here should go here would be appreciated.

Share Improve this question edited Jun 20, 2018 at 16:03 MrWhite 3,8911 gold badge20 silver badges23 bronze badges asked Jun 20, 2018 at 12:55 jammjamm 11 silver badge1 bronze badge 3
  • Can I ask why it's a necessity to use a custom port? It almost seems like THAT is the problem that needs fixing ;) – mayersdesign Commented Jun 20, 2018 at 13:18
  • port 80 in use elsewhere and need to keep that separate unfortunately. – jamm Commented Jun 20, 2018 at 13:20
  • You shouldn't need to modify the basic WordPress .htaccess file if you are accessing the site via a different port. Do you have a custom .htaccess file of some kind? The .htaccess code you posted is invalid and will never match (it just won't do anything). If you are getting a "timeout" then it suggests you have a problem with your server/DNS. – MrWhite Commented Jun 20, 2018 at 13:39
Add a comment  | 

1 Answer 1

Reset to default 0

To be honest, I'd change my .conf file to state the correct port if you've got access to that.

For instance.

<VirtualHost *:8012>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www/LOCATION OF FILES
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory /var/www/LOCATION OF FILES>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>

Then i'd restart apache. (if you are using apache that is)

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736258326a504.html

最新回复(0)