Domain Mapping in WordPress - wordpress

I have already spent hours on this, and i don't make any progress. How can i mask or map my WordPress page into my sub-domain without re installing the whole WordPress files again? I have tried those multi-site plugins and it gave me a fresh copy of WordPress! I don't want that.
I have also tried the WPMU domain mapping plugin, but the subdomain outputs the homepage.
What i want is:
e.g i want my URL www.mysite.com/mypage to become mypage.mysite.com
Is this even possible? Also, I have already created a wildcard sub-domain in my cPanel.
NOTE* This will be only for 1 page only.
here's my current .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mypage\.domain\.com\.es$
RewriteRule ^(.*)$ http://domain.com.es/mypage/ [L,QSA]
</IfModule>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Related

wordpress wp-content/uploads folder 301 redirect to S3 bucket by cloudfrond CDN by .htaccess issues

See below, the .htacess file from Wordpress. If I remove the part starting from # BEGIN WordPress, all the image file URLs will be changed to d28rt1vkpsdxas.cloudfront.net/someimage.png successfully.
However, all the internal links will be unable to access (only the home page can access). The error is
Not Found The requested URL /shop/ was not found on this server.
But if I keep the part start from # BEGIN WordPress, the CDN redirect will not work anymore. All photos are missing.
Options +FollowSymlinks
RewriteEngine on
Rewriterule ^wp-content/uploads/(.*)$ http://exampled28t1vkps.cloudfront.net/$1 [r=301,nc]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
You’re missing the [L] flag, which prevents other rules from redirecting:
Rewriterule ^wp-content/uploads/(.*)$ http://exampled28t1vkps.cloudfront.net/$1 [r=301,nc,l]

Wordpress site in subfolder of another wordpress site .htaccess issue

I have a wordpress site in a folder
/site1
That site is site1.com
I have another wordpress site (totally separate install) in a subfolder of that site
/site1/site2
That site is site2.com
Ideally I would like to be able to access this site by typing either of these two things...
site1.com/site2
or
site2.com
So far, that works. However, I can't do something that's really important.
I can't type, say
site2.com/forums and get to my forums. I get an internal server error. The only way to get to the forums is to go all the way back to site1.com/site2/forums
Can someone tell me what needs to change in my .htacces, wp-config, or wordpress dashboard to make this happen (and in what subfolder to make these changes?)
.htaccess for site1
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
<Files 403.shtml>
order allow,deny
allow from all
</Files>
.htaccess for site2
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /site2/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /site2/index.php [L]
</IfModule>
# END WordPress
As stated in the comments, both the wp url and site url are http://site1.com/site2 as doing anything else broke the sites.

wordpress permalink and https and folder redirect

I "inherited" a website at the department I am working at that is hosted on a machine we don't have root access to. I managed to force https with the .htaccess file, but I was unable to add wordpress permalinks to it also. The combinations I tried all ended up pointing every link to the front page.
This is the .htaccess we have now (the wordpress website is in a subdirectory):
RewriteEngine on
RewriteCond %{HTTP_HOST} ^familydogproject.elte.hu$
RewriteCond %{REQUEST_URI} !wordpress/
RewriteRule ^ https://%{HTTP_HOST}/wordpress/%{REQUEST_URI} [L,R=301]
And this is the example wordpress gave for the permalinks:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Does anybody have any idea how to combine them?

Some WordPress permalink problems, probably depending by wrong .htaccess configuration?

I have import on my local webserver a backup of a website made using WordPress but I am finding some difficulties with PermaLink configuration
The main problem is that if I use the permalink setted as Article Name I can see the homepage but if I click on the articles links into the homepage (to see the article) I always obtain the following message error:
Not Found
The requested URL
/wordpress35/2012/10/11/se-milano-avesse-il-mare-anzi-no-la-montagna-di-campiglio/
was not found on this server.
If I instead I use the Default settings for permalink (http://localhost/wordpress35/?p=123) I have no problem and I can access to the articles in my website
I think that this is a .htaccess problem. Can you help me to create an .htaccess file that solve this problem?
My actual .htaccess file is:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
I need to use the URL format described as: http://localhost/wordpress35/my-article-name
Did you try creating a the wordpress .htaccess for your needs?
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
This should work if you didn't specify any change in the website's URL.
(If the homepage is still http://localhost/wordpress35/ )

htaccess redirect problems, Wordpress and static html site not redirecting properly

I'm having problems with a customer's website. I've created a new Wordpress site for him and now I'm having problems with htaccess redirecting.
Before I installed Wordpress on the server, there was two static basic HTML-sites. One in the public_html root using the main domain and a completely different subsite in a subfolder with a htaccess rewrite rule directing the subdomain into that folder.
Now there is Wordpress messing up the redirects. Wordpress of course made modifications to the original htaccess-file. In addition to that, the customer also had to change servers within the hosting provider to get newer php version so I had to write the htaccess file from scratch.
Here is the current htaccess-file :
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /www/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /www/index.php [L]
</IfModule>
# END WordPress
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www.)?subdomainurl.com$ [NC]
RewriteCond %{REQUEST_URI} !^/subdomainfolder/
RewriteRule ^(.*)$ subdomainfolder/$1 [L]
Wordpress in installed in a folder named www and the url is being rewritten, it works beautifully. But I'm having problems with the subdomain. In the code above I've replaced the subdomain url with subdomainurl.com, the site lies in public_html/subdomainfolder/.
Now, when I type www.subdomainurl.com, the redirect works, the site is shown. But www.subdomainurl.index.html typed doesn't. It has to be written www.subdomainurl.com/subdomainfolder/index.html, so I'm clearly not writing the redirect right, adding the subdomain folder as well. I've tried to mingle with that htaccess but can't get it right. Everytime I try to change something I get a 404 in the main domain's Wordpress site.
At the moment these work:
www.maindomain.com/subdomainfolder/index.html
www.subdomainurl.com/subdomainfolder/index.html
And this doesn't, which I'm trying to do:
www.subdomainurl.com/index.html
I'm not a redirect expert, any help would be much appreciated.
Edit/Addon :
Here is the old code from the old server that redirected the subdomain to the subfolder and rewrote the url, it doesn't work anymore so I ditched it.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?subdomainurl.com$ [NC]
RewriteCond %{REQUEST_URI} !^/subdomainfolder/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /subdomainfolder/$1
RewriteCond %{HTTP_HOST} ^(www.)?subdomainurl.com$ [NC]
RewriteRule ^(/)?$ subdomainfolder/index.html [L]
I don't see an entry in the htaccess file for just the subdomain and for the main domain.
Currently I'm using this code
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /www/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /www/index.php [L]
</IfModule>
END WordPress
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www.)?subdomainurl.com$ [NC]
RewriteCond %{REQUEST_URI} !subdomainfolder
RewriteRule ^(.*)$ subdomainfolder$1
This loads the whole secondary domain (subdomainurl.com) as www.subdomainurl.com/subdomainfolder and it works like that (www.subdomainurl.com/subdomainfolder/index.html, www.subdomainurl.com/subdomainfolder/work.html etc.), but it still isn't what the customer really wanted. I still need to eliminate the subdomainfolder-part from the url by htaccess, so far I haven't had success. I suppose I haven't got it right on the final row of the code.

Resources