I have a folder structure like this
/
/project1
I normally use it with one domain (example.com), but now I want to use it as a sepreate domain (project1.example.com) and I am using apache virtualhost. I have succeed to setup, but some problem on the link happened. All the hyperlink in project1 is the path included the "project1" subfolder (e.g. project1/image/pic.jpg). I setup like this
DocumentRoot /doc_root/
Alias /project1 /doc_root/project1/
Alias / /doc_root/project1
RewriteRule /project1/(.*) /$1 [R]
The problem is when i rewrite clean url e.g. example.com/project1/post?id=1 => project1.example.com/post/1 With
RewriteRule ^/post/(\d+)$ /project1/post.php?id=$1 [PT,NC,L,QSA]
I am getting 404 error in the ajax post in the page Since the ajax url is pointed to /project1/process.php And I think this request is not rewriting.
What is the proper way to setup like this? thanks!